1919jobs :
2020 build-zephyr-binaries :
2121 name : Build Zephyr Binaries
22- runs-on : ubuntu-22.04
22+ strategy :
23+ matrix :
24+ os :
25+ - ubuntu-22.04
26+ - windows-2025
27+ runs-on : ${{ matrix.os }}
2328 steps :
2429 - name : Checkout
2530 uses : actions/checkout@v4
3035 python-version : ' 3.12'
3136
3237 - name : Install Dependencies
38+ shell : bash
3339 run : |
34- sudo apt-get -qqy update
35- sudo apt-get install -qqy cmake ninja-build
40+ if [ "${{ runner.os }}" = "Linux" ]; then
41+ sudo apt-get -qqy update
42+ sudo apt-get install -qqy cmake ninja-build
43+ elif [ "${{ runner.os }}" = "Windows" ]; then
44+ choco feature enable -n allowGlobalConfirmation
45+ choco install ninja cmake
46+ else
47+ echo "Unknown runner!"
48+ exit 1
49+ fi
3650
3751 - name : Setup Zephyr project
3852 uses : zephyrproject-rtos/action-zephyr-setup@v1
4155 toolchains : arm-zephyr-eabi
4256
4357 - name : Build Zephyr
58+ shell : bash
4459 run : |
4560 mkdir -p artifacts/zephyr_binaries
4661 for example in examples/*/zephyr; do
@@ -52,32 +67,124 @@ jobs:
5267 - name : Upload Zephyr binaries
5368 uses : actions/upload-artifact@v4
5469 with :
55- name : zephyr_binaries-${{ github.run_id }}
70+ name : zephyr_binaries-${{ runner.os }}-${{ github.run_id }}
5671 path : artifacts/zephyr_binaries
5772
73+ build-systemc :
74+ name : Build SystemC
75+ strategy :
76+ matrix :
77+ os :
78+ - ubuntu-22.04
79+ - windows-2025
80+ runs-on : ${{ matrix.os }}
81+ steps :
82+ - uses : actions/checkout@v4
83+ with :
84+ submodules : true
85+
86+ - name : Install dependencies
87+ shell : bash
88+ run : |
89+ if [ "${{ runner.os }}" = "Linux" ]; then
90+ sudo apt-get -qqy update
91+ sudo apt-get install -qqy cmake
92+ elif [ "${{ runner.os }}" = "Windows" ]; then
93+ choco feature enable -n allowGlobalConfirmation
94+ choco install cmake
95+ else
96+ echo "Unknown runner!"
97+ exit 1
98+ fi
99+
100+ - name : Set CMake generator
101+ if : runner.os == 'Windows'
102+ shell : bash
103+ run : |
104+ export CMAKE_GENERATOR="Visual Studio 17 2022"
105+
106+ - name : Build library
107+ shell : bash
108+ run : |
109+ mkdir -p build
110+ pushd build
111+ cmake ../systemc -DBUILD_SHARED_LIBS=OFF \
112+ -DCMAKE_CXX_STANDARD=14 \
113+ -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
114+
115+ cmake --build . -j $(nproc)
116+ popd
117+
118+ - name : Upload library (Linux)
119+ if : runner.os == 'Linux'
120+ uses : actions/upload-artifact@v4
121+ with :
122+ name : ${{ runner.os }}-${{ github.run_id }}-libsystemc.a
123+ path : build/src/libsystemc.a
124+
125+ - name : Upload library (Windows)
126+ if : runner.os == 'Windows'
127+ uses : actions/upload-artifact@v4
128+ with :
129+ name : ${{ runner.os }}-${{ github.run_id }}-libsystemc.lib
130+ path : build/src/Debug/systemc.lib
131+
58132 build-examples :
59133 name : Build Examples
134+ strategy :
135+ matrix :
136+ os :
137+ - ubuntu-22.04
138+ - windows-2025
139+ needs : build-systemc
60140 runs-on : ubuntu-22.04
61141 steps :
62142 - uses : actions/checkout@v4
143+ with :
144+ submodules : true
145+
146+ - name : Download SystemC library
147+ uses : actions/download-artifact@v4
148+ with :
149+ pattern : (Windows|Linux)-libsystemc\.(a|lib)
150+ path : artifacts/systemc
63151
64152 - name : Install dependencies
153+ shell : bash
65154 run : |
66- sudo apt-get -qqy update
67- sudo apt-get install -qqy libsystemc libsystemc-dev clang cmake dotnet-sdk-8.0
155+ if [ "${{ runner.os }}" = "Linux" ]; then
156+ sudo apt-get -qqy update
157+ sudo apt-get install -qqy cmake
158+ elif [ "${{ runner.os }}" = "Windows" ]; then
159+ choco feature enable -n allowGlobalConfirmation
160+ choco install cmake
161+ else
162+ echo "Unknown runner!"
163+ exit 1
164+ fi
68165
69166 - name : Download and build Renode
70167 uses : antmicro/renode-test-action@v5.0.0
71168 with :
72169 renode-repository : ${{ inputs.renode_gitrepo || 'https://github.com/renode/renode' }}
73170 renode-revision : ${{ inputs.renode_gitrev || 'master' }}
74171
172+ - name : Set CMake generator
173+ if : runner.os == 'Windows'
174+ shell : bash
175+ run : |
176+ export CMAKE_GENERATOR="Visual Studio 17 2022"
177+
75178 - name : Build examples
179+ shell : bash
76180 run : |
77181 mkdir -p build
78182 pushd build
79- cmake ..
80- make CPPSTD=c++14 -j $(nproc)
183+ cmake .. -DUSER_SYSTEMC_INCLUDE_DIR=$(pwd)/../systemc/src \
184+ -DUSER_SYSTEMC_LIB_DIR=$(pwd)/../artifacts/systemc \
185+ -DCMAKE_CXX_STANDARD=14
186+ make -j $(nproc)
187+ # make CPPSTD=c++14 -j $(nproc)
81188 popd
82189
83190 mkdir -p artifacts/example_binaries artifacts/test_binaries
@@ -93,13 +200,13 @@ jobs:
93200 - name : Upload Example Binaries
94201 uses : actions/upload-artifact@v4
95202 with :
96- name : example_binaries-${{ github.run_id }}
203+ name : example_binaries-${{ runner.os }}-${{ github.run_id }}
97204 path : artifacts/example_binaries
98205
99206 - name : Upload Test Binaries
100207 uses : actions/upload-artifact@v4
101208 with :
102- name : test_binaries-${{ github.run_id }}
209+ name : test_binaries-${{ runner.os }}-${{ github.run_id }}
103210 path : artifacts/test_binaries
104211
105212 test-examples :
@@ -112,7 +219,7 @@ jobs:
112219 - name : Install dependencies
113220 run : |
114221 sudo apt-get -qqy update
115- sudo apt-get install -qqy libsystemc libsystemc-dev dotnet-sdk-8.0
222+ sudo apt-get install -qqy libsystemc libsystemc-dev
116223
117224 - name : Download example binaries
118225 uses : actions/download-artifact@v4
0 commit comments