Skip to content

Commit f2b741b

Browse files
committed
wip: gh wf native
1 parent 6731a6f commit f2b741b

File tree

1 file changed

+51
-10
lines changed

1 file changed

+51
-10
lines changed

.github/workflows/test.yml

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
mkdir -p build
110110
pushd build
111111
cmake ../systemc -DBUILD_SHARED_LIBS=OFF \
112+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
112113
-DCMAKE_CXX_STANDARD=14 \
113114
-DCMAKE_POLICY_VERSION_MINIMUM="3.5"
114115
@@ -146,10 +147,10 @@ jobs:
146147
run: |
147148
if [ "${{ runner.os }}" = "Linux" ]; then
148149
sudo apt-get -qqy update
149-
sudo apt-get install -qqy cmake
150+
sudo apt-get install -qqy cmake tree
150151
elif [ "${{ runner.os }}" = "Windows" ]; then
151152
choco feature enable -n allowGlobalConfirmation
152-
choco install cmake
153+
choco install cmake tree
153154
else
154155
echo "Unknown runner!"
155156
exit 1
@@ -159,7 +160,8 @@ jobs:
159160
uses: antmicro/renode-test-action@v5.0.0
160161
with:
161162
renode-repository: ${{ inputs.renode_gitrepo || 'https://github.com/renode/renode' }}
162-
renode-revision: ${{ inputs.renode_gitrev || 'master' }}
163+
renode-revision: ${{ '88743-native-systemc' }}
164+
# renode-revision: ${{ inputs.renode_gitrev || 'master' }}
163165

164166
- name: Set CMake generator
165167
if: runner.os == 'Windows'
@@ -177,26 +179,35 @@ jobs:
177179
-DCMAKE_CXX_STANDARD=14
178180
179181
cmake --build . -j $(nproc)
180-
popd
181182
182-
mkdir -p artifacts/example_binaries artifacts/test_binaries
183+
tree .
184+
popd
183185
184186
if [ "${{ runner.os }}" = "Linux" ]; then
185-
bin_path="bin"
187+
bin_path="."
186188
elif [ "${{ runner.os }}" = "Windows" ]; then
187-
bin_path="bin/Debug"
189+
bin_path="Debug"
188190
else
189191
echo "Unknown runner!"
190192
exit 1
191193
fi
192194
195+
mkdir -p build
196+
mkdir -p artifacts/{example_binaries,test_binaries,shared_libs}
197+
193198
for example in examples/*/; do
194199
example_name="$(basename $example)"
195-
cp examples/$example_name/$bin_path/$example_name artifacts/example_binaries/x64-systemc--$example_name.elf
200+
cp build/examples/$example_name/$bin_path/$example_name artifacts/example_binaries/x64-systemc--$example_name
196201
done
197202
for test in tests/*/; do
198203
test_name="$(basename $test)"
199-
cp tests/$test_name/$bin_path/$test_name artifacts/test_binaries/x64-systemc--$test_name.elf
204+
cp build/tests/$test_name/$bin_path/$test_name artifacts/test_binaries/x64-systemc--$test_name
205+
done
206+
for example in examples-native/*/; do
207+
example_name="$(basename $example)"
208+
# library_name="lib$(basename $example | tr '-' '_').$lib"
209+
library_name="lib$(basename $example | tr '-' '_')"
210+
cp build/examples-native/$example_name/$bin_path/$library_name.{so,dll} artifacts/shared_libs/
200211
done
201212
202213
- name: Upload Example Binaries
@@ -211,6 +222,13 @@ jobs:
211222
name: test_binaries-${{ runner.os }}-${{ github.run_id }}
212223
path: artifacts/test_binaries
213224

225+
- name: Upload Example Libs
226+
uses: actions/upload-artifact@v4
227+
with:
228+
name: test_binaries-${{ runner.os }}-${{ github.run_id }}
229+
path: artifacts/shared_libs
230+
231+
214232
test-examples:
215233
name: Test Examples
216234
needs: build-examples
@@ -235,11 +253,30 @@ jobs:
235253
name: test_binaries-${{ runner.os }}-${{ github.run_id }}
236254
path: artifacts/test_binaries
237255

256+
- name: Download example libs
257+
uses: actions/download-artifact@v4
258+
with:
259+
name: example_libs-${{ runner.os }}-${{ github.run_id }}
260+
path: artifacts/shared_libs
261+
238262
- name: Download and build Renode
239263
uses: antmicro/renode-test-action@v5.0.0
240264
with:
241265
renode-repository: ${{ inputs.renode_gitrepo || 'https://github.com/renode/renode' }}
242-
renode-revision: ${{ inputs.renode_gitrev || 'master' }}
266+
renode-revision: ${{ '88743-native-systemc' }}
267+
# renode-revision: ${{ inputs.renode_gitrev || 'master' }}
268+
269+
- name: Set library path
270+
shell: bash
271+
run: |
272+
if [ "${{ runner.os }}" = "Linux" ]; then
273+
export LD_LIBRARY_PATH="$(realpath artifacts/shared_libs):$LD_LIBRARY_PATH"
274+
elif [ "${{ runner.os }}" = "Windows" ]; then
275+
export PATH="$(realpath artifacts/shared_libs):$PATH"
276+
else
277+
echo "Unknown runner!"
278+
exit 1
279+
fi
243280
244281
- name: Run tests
245282
shell: bash
@@ -256,6 +293,10 @@ jobs:
256293
cp $test tests/$test_name/bin/$test_name
257294
done
258295
296+
pushd examples-native
297+
renode-test -t all_examples.yaml
298+
popd
299+
259300
pushd examples
260301
renode-test -t all_examples.yaml
261302
popd

0 commit comments

Comments
 (0)