Skip to content

Commit a3383b4

Browse files
authored
Merge pull request #179 from Cycling74/actions
This PR makes some changes to reduce the number of CI minutes spent for every commit. Release workflow The existing CI workflow is renamed to Release and only runs when manually triggered. Previously, this workflow ran for every push and pull request on all branches. Test workflow The test workflow builds and runs the tests with debug and release configurations on macOS and Windows. Instead of running the debug and release configurations in parallel (like what the release workflow does), we run the builds in sequence. This saves an additional checkout and CMake project generation, and also ensures that the release build does not run if the more strict debug build fails. The test workflow runs automatically on every push to master or develop, as well as every PR that wants to merge to one of these branches. And finally, the latest Xcode is now used to build on macOS.
2 parents 8f1da21 + 6130f94 commit a3383b4

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: CI
1+
name: Release
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch:
45

56
jobs:
67
package:
@@ -16,11 +17,6 @@ jobs:
1617
submodules: 'recursive'
1718
fetch-depth: '0'
1819

19-
- uses: maxim-lobanov/setup-xcode@v1
20-
if: matrix.os == 'macos-latest'
21-
with:
22-
xcode-version: '11.7'
23-
2420
- uses: benjlevesque/[email protected]
2521
id: short-sha
2622
with:

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
workflow_dispatch:
13+
14+
jobs:
15+
test:
16+
name: Build and test
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: [macos-latest, windows-latest]
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
submodules: 'recursive'
26+
fetch-depth: '0'
27+
28+
- name: Configure macOS
29+
if: matrix.os == 'macos-latest'
30+
run: mkdir build && cd build && cmake -G Xcode ..
31+
32+
- name: Configure Windows
33+
if: matrix.os == 'windows-latest'
34+
run: mkdir build && cd build && cmake ..
35+
36+
- name: Build Debug
37+
run: cmake --build build --config 'Debug'
38+
39+
- name: Test Debug
40+
run: cd build && ctest -C 'Debug' . -V
41+
42+
- name: Build Release
43+
run: cmake --build build --config 'Release'
44+
45+
- name: Test Release
46+
run: cd build && ctest -C 'Release' . -V

0 commit comments

Comments
 (0)