|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | cmake-test-macos: |
11 | | - runs-on: ${{ matrix.os }}-${{ matrix.os_version }} |
| 11 | + uses: ./.github/workflows/cmake-test-on.yml |
| 12 | + with: |
| 13 | + os: ${{ matrix.os }} |
| 14 | + os_version: ${{ matrix.os_version }} |
| 15 | + compiler: ${{ matrix.compiler }} |
| 16 | + triplet: ${{ matrix.triplet }} |
| 17 | + variant: ${{ matrix.variant }} |
12 | 18 | strategy: |
13 | 19 | fail-fast: false |
14 | 20 | matrix: |
15 | 21 | os: [macos] |
16 | 22 | os_version: [latest] |
17 | 23 | compiler: [clang++] |
18 | 24 | variant: [Debug, Release] |
19 | | - include: |
20 | | - - os: macos |
21 | | - target-cpu: arm64 |
22 | | - target-os: osx |
23 | | - target-compiler: clang |
24 | | - env: |
25 | | - OUTPUT_BINARY: firestarr-${{ matrix.os }}-${{ matrix.target-cpu}}-${{ matrix.target-compiler }}-${{ matrix.variant }} |
26 | | - steps: |
27 | | - - uses: ./.github/workflows/cmake-test-on.yml |
28 | | - with: |
29 | | - os: ${{ matrix.os }} |
30 | | - os_version: ${{ matrix.os_version }} |
31 | | - compiler: ${{ matrix.compiler }} |
32 | | - triplet: ${{ matrix.target-cpu }}-${{ matrix.target-os }} |
33 | | - variant: ${{ matrix.variant }} |
34 | | - |
35 | | - - name: Locate binary |
36 | | - id: locate |
37 | | - run: | |
38 | | - # Find the built executable |
39 | | - BINARY=$(find build -type f -name "firestarr" -perm +111 | head -1) |
40 | | - if [ -z "$BINARY" ]; then |
41 | | - echo "ERROR: Could not find firestarr binary" |
42 | | - find build -type f -perm +111 |
43 | | - exit 1 |
44 | | - fi |
45 | | - echo "binary=$BINARY" >> $GITHUB_OUTPUT |
46 | | - echo "Found binary at: $BINARY" |
47 | | -
|
48 | | - - name: Check binary dependencies |
49 | | - run: | |
50 | | - echo "=== Binary info ===" |
51 | | - file ${{ steps.locate.outputs.binary }} |
52 | | - echo "" |
53 | | - echo "=== Dynamic dependencies ===" |
54 | | - otool -L ${{ steps.locate.outputs.binary }} || true |
55 | | -
|
56 | | - - name: Package artifact |
57 | | - run: | |
58 | | - mkdir -p dist |
59 | | - cp ${{ steps.locate.outputs.binary }} dist/firestarr |
60 | | -
|
61 | | - # Bundle data files if they exist |
62 | | - [ -f firestarr/fuel.lut ] && cp firestarr/fuel.lut dist/ |
63 | | - [ -f firestarr/settings.ini ] && cp firestarr/settings.ini dist/ |
64 | | - [ -f firestarr/data/fuel.lut ] && cp firestarr/data/fuel.lut dist/ |
65 | | - [ -f firestarr/data/settings.ini ] && cp firestarr/data/settings.ini dist/ |
66 | | -
|
67 | | - # Create version info |
68 | | - cd firestarr && git rev-parse HEAD > ../dist/VERSION && cd .. |
69 | | -
|
70 | | - # List contents |
71 | | - echo "=== Package contents ===" |
72 | | - ls -la dist/ |
73 | | -
|
74 | | - # Create tarball |
75 | | - tar -czvf ${{ env.OUTPUT_BINARY }}.tar.gz -C dist . |
76 | | -
|
77 | | - - name: Upload artifact |
78 | | - uses: actions/upload-artifact@v4 |
79 | | - with: |
80 | | - name: ${{ env.OUTPUT_BINARY }} |
81 | | - path: ${{ env.OUTPUT_BINARY }}.tar.gz |
82 | | - retention-days: 30 |
83 | | - |
84 | 25 |
|
85 | 26 | cmake-test-ubuntu: |
86 | | - runs-on: ${{ matrix.os }}-${{ matrix.os_version }} |
| 27 | + uses: ./.github/workflows/cmake-test-on.yml |
| 28 | + with: |
| 29 | + os: ${{ matrix.os }} |
| 30 | + os_version: ${{ matrix.os_version }} |
| 31 | + compiler: ${{ matrix.compiler }} |
| 32 | + triplet: ${{ matrix.triplet }} |
| 33 | + variant: ${{ matrix.variant }} |
87 | 34 | strategy: |
88 | 35 | fail-fast: false |
89 | 36 | matrix: |
90 | 37 | os: [ubuntu] |
91 | 38 | os_version: [22.04, 24.04] |
92 | 39 | compiler: [clang++, g++] |
93 | 40 | variant: [Debug, Release] |
94 | | - include: |
95 | | - - os: ubuntu |
96 | | - target-cpu: x64 |
97 | | - target-os: linux |
98 | | - - compiler: clang++ |
99 | | - target-compiler: clang |
100 | | - - compiler: g++ |
101 | | - target-compiler: gcc |
102 | | - env: |
103 | | - OUTPUT_BINARY: firestarr-${{ matrix.os }}-${{ matrix.target-cpu}}-${{ matrix.target-compiler }}-${{ matrix.variant }} |
104 | | - steps: |
105 | | - - uses: ./.github/workflows/cmake-test-on.yml |
106 | | - with: |
107 | | - os: ${{ matrix.os }} |
108 | | - os_version: ${{ matrix.os_version }} |
109 | | - compiler: ${{ matrix.compiler }} |
110 | | - triplet: ${{ matrix.target-cpu }}-${{ matrix.target-os }} |
111 | | - variant: ${{ matrix.variant }} |
112 | | - |
113 | | - - name: Locate binary |
114 | | - id: locate |
115 | | - run: | |
116 | | - # Find the built executable |
117 | | - BINARY=$(find build -type f -name "firestarr" -executable | head -1) |
118 | | - if [ -z "$BINARY" ]; then |
119 | | - echo "ERROR: Could not find firestarr binary" |
120 | | - find build -type f -executable |
121 | | - exit 1 |
122 | | - fi |
123 | | - echo "binary=$BINARY" >> $GITHUB_OUTPUT |
124 | | - echo "Found binary at: $BINARY" |
125 | | -
|
126 | | - - name: Check binary dependencies |
127 | | - run: | |
128 | | - echo "=== Binary info ===" |
129 | | - file ${{ steps.locate.outputs.binary }} |
130 | | - echo "" |
131 | | - echo "=== Dynamic dependencies ===" |
132 | | - ldd ${{ steps.locate.outputs.binary }} || true |
133 | | -
|
134 | | - - name: Package artifact |
135 | | - run: | |
136 | | - mkdir -p dist |
137 | | - cp ${{ steps.locate.outputs.binary }} dist/firestarr |
138 | | -
|
139 | | - # Bundle data files if they exist |
140 | | - [ -f firestarr/fuel.lut ] && cp firestarr/fuel.lut dist/ |
141 | | - [ -f firestarr/settings.ini ] && cp firestarr/settings.ini dist/ |
142 | | - [ -f firestarr/data/fuel.lut ] && cp firestarr/data/fuel.lut dist/ |
143 | | - [ -f firestarr/data/settings.ini ] && cp firestarr/data/settings.ini dist/ |
144 | | -
|
145 | | - # Create version info |
146 | | - cd firestarr && git rev-parse HEAD > ../dist/VERSION && cd .. |
147 | | -
|
148 | | - # List contents |
149 | | - echo "=== Package contents ===" |
150 | | - ls -la dist/ |
151 | | -
|
152 | | - # Create tarball |
153 | | - tar -czvf ${{ env.OUTPUT_BINARY }}.tar.gz -C dist . |
154 | | -
|
155 | | - - name: Upload artifact |
156 | | - uses: actions/upload-artifact@v4 |
157 | | - with: |
158 | | - name: ${{ env.OUTPUT_BINARY }} |
159 | | - path: ${{ env.OUTPUT_BINARY }}.tar.gz |
160 | | - retention-days: 30 |
161 | | - |
162 | 41 |
|
163 | 42 | cmake-test-windows: |
164 | | - runs-on: ${{ matrix.os }}-${{ matrix.os_version }} |
| 43 | + uses: ./.github/workflows/cmake-test-on.yml |
| 44 | + with: |
| 45 | + os: ${{ matrix.os }} |
| 46 | + os_version: ${{ matrix.os_version }} |
| 47 | + compiler: ${{ matrix.compiler }} |
| 48 | + triplet: ${{ matrix.triplet }} |
| 49 | + variant: ${{ matrix.variant }} |
165 | 50 | strategy: |
166 | 51 | fail-fast: false |
167 | 52 | matrix: |
168 | 53 | os: [windows] |
169 | 54 | os_version: [latest] |
170 | 55 | compiler: [cl] |
171 | 56 | variant: [Debug, Release] |
172 | | - include: |
173 | | - - os: windows |
174 | | - target-cpu: x64 |
175 | | - target-os: windows |
176 | | - env: |
177 | | - OUTPUT_BINARY: firestarr-${{ matrix.os }}-${{ matrix.target-cpu}}-${{ matrix.target-compiler }}-${{ matrix.variant }} |
178 | | - steps: |
179 | | - - uses: ./.github/workflows/cmake-test-on.yml |
180 | | - with: |
181 | | - os: ${{ matrix.os }} |
182 | | - os_version: ${{ matrix.os_version }} |
183 | | - compiler: ${{ matrix.compiler }} |
184 | | - triplet: ${{ matrix.target-cpu }}-${{ matrix.target-os }} |
185 | | - variant: ${{ matrix.variant }} |
186 | | - |
187 | | - - name: Locate binary |
188 | | - id: locate |
189 | | - run: | |
190 | | - $BINARY = Get-ChildItem -Path build -Recurse -Filter "firestarr.exe" | Select-Object -First 1 -ExpandProperty FullName |
191 | | - if (-not $BINARY) { |
192 | | - echo "ERROR: Could not find firestarr.exe" |
193 | | - Get-ChildItem -Path build -Recurse -Filter "*.exe" | Select-Object FullName |
194 | | - exit 1 |
195 | | - } |
196 | | - echo "binary=$BINARY" >> $env:GITHUB_OUTPUT |
197 | | - echo "Found binary at: $BINARY" |
198 | | - shell: pwsh |
199 | | - |
200 | | - - name: Check binary dependencies |
201 | | - run: | |
202 | | - echo "=== Binary info ===" |
203 | | - Get-Item "${{ steps.locate.outputs.binary }}" | Format-List Name, Length, LastWriteTime |
204 | | - echo "" |
205 | | - echo "=== Binary size ===" |
206 | | - (Get-Item "${{ steps.locate.outputs.binary }}").Length / 1MB | ForEach-Object { "{0:N2} MB" -f $_ } |
207 | | - shell: pwsh |
208 | | - |
209 | | - - name: Package artifact |
210 | | - run: | |
211 | | - New-Item -ItemType Directory -Force -Path dist |
212 | | -
|
213 | | - Copy-Item "${{ steps.locate.outputs.binary }}" dist\firestarr.exe |
214 | | -
|
215 | | - # Copy required DLLs from vcpkg |
216 | | - $vcpkgBin = "C:\vcpkg\installed\x64-windows\bin" |
217 | | - if (Test-Path $vcpkgBin) { |
218 | | - Get-ChildItem "$vcpkgBin\*.dll" | Copy-Item -Destination dist\ |
219 | | - } |
220 | | -
|
221 | | - # Bundle data files if they exist |
222 | | - if (Test-Path firestarr\fuel.lut) { Copy-Item firestarr\fuel.lut dist\ } |
223 | | - if (Test-Path firestarr\settings.ini) { Copy-Item firestarr\settings.ini dist\ } |
224 | | - if (Test-Path firestarr\data\fuel.lut) { Copy-Item firestarr\data\fuel.lut dist\ } |
225 | | - if (Test-Path firestarr\data\settings.ini) { Copy-Item firestarr\data\settings.ini dist\ } |
226 | | -
|
227 | | - # Create version info |
228 | | - cd firestarr |
229 | | - git rev-parse HEAD | Out-File -FilePath ..\dist\VERSION -Encoding utf8 |
230 | | - cd .. |
231 | | -
|
232 | | - # List contents |
233 | | - echo "=== Package contents ===" |
234 | | - Get-ChildItem dist |
235 | | -
|
236 | | - # Create zip |
237 | | - Compress-Archive -Path dist\* -DestinationPath ${{ env.OUTPUT_BINARY }}.zip |
238 | | - shell: pwsh |
239 | | - |
240 | | - - name: Upload artifact |
241 | | - uses: actions/upload-artifact@v4 |
242 | | - with: |
243 | | - name: ${{ env.OUTPUT_BINARY }} |
244 | | - path: ${{ env.OUTPUT_BINARY }}.tar.gz |
245 | | - retention-days: 30 |
246 | 57 |
|
247 | 58 | cmake-test: |
248 | 59 | needs: [cmake-test-ubuntu, cmake-test-macos, cmake-test-windows] |
249 | 60 | runs-on: ubuntu-latest |
250 | | - permissions: |
251 | | - contents: write |
252 | 61 |
|
253 | 62 | steps: |
254 | | - - name: Download all artifacts |
255 | | - uses: actions/download-artifact@v4 |
256 | | - |
257 | | - - name: List artifacts |
258 | | - run: | |
259 | | - echo "=== All artifacts ===" |
260 | | - find . -type f \( -name "*.tar.gz" -o -name "*.zip" \) |
261 | | -
|
262 | | - - name: Update firestarr-latest release (manual runs) |
263 | | - if: github.event_name == 'workflow_dispatch' |
264 | | - uses: softprops/action-gh-release@v2 |
265 | | - with: |
266 | | - tag_name: firestarr-latest |
267 | | - name: "FireSTARR Latest Build" |
268 | | - body: | |
269 | | - Latest FireSTARR binaries built from upstream. |
270 | | -
|
271 | | - **FireSTARR ref:** ${{ github.event.inputs.firestarr_ref || 'main' }} |
272 | | - **Built:** ${{ github.run_id }} |
273 | | - **Workflow run:** https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
274 | | - prerelease: true |
275 | | - make_latest: false |
276 | | - files: | |
277 | | - *.tar.gz |
278 | | - *.zip |
279 | | -
|
280 | | - - name: Attach to release (release events) |
281 | | - if: github.event_name == 'release' |
282 | | - uses: softprops/action-gh-release@v2 |
283 | | - with: |
284 | | - files: | |
285 | | - *.tar.gz |
286 | | - *.zip |
| 63 | + - run: | |
| 64 | + echo "All tests completed" |
0 commit comments