Skip to content

Commit ff12c1c

Browse files
authored
Merge pull request #51 from PartStackerCommunity/ci
Add tests to the GitHub Actions
2 parents 0af368d + f37c5ba commit ff12c1c

4 files changed

Lines changed: 106 additions & 25 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: macos
2+
3+
inputs:
4+
config-preset:
5+
required: true
6+
build-preset:
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Select Xcode version
13+
run: sudo xcode-select -switch /Applications/Xcode_16.3.app
14+
shell: bash
15+
16+
- name: Configure PartStacker
17+
run: |
18+
cmake --preset ${{ inputs.config-preset }} \
19+
-G Xcode \
20+
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
21+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.6
22+
shell: bash
23+
24+
- name: Build PartStacker
25+
run: |
26+
cmake --build --preset ${{ inputs.build-preset }} -j8
27+
shell: bash
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: windows
2+
3+
inputs:
4+
config-preset:
5+
required: true
6+
build-preset:
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Configure PartStacker
13+
run: |
14+
cmake --preset ${{ inputs.config-preset }} -G "Visual Studio 17 2022" -A x64
15+
shell: powershell
16+
17+
- name: Build PartStacker
18+
run: |
19+
cmake --build --preset ${{ inputs.build-preset }} -j8
20+
shell: powershell

.github/workflows/build.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,45 @@ on:
22
workflow_dispatch:
33

44
jobs:
5-
windows:
6-
runs-on: windows-2025
5+
run-tests:
6+
uses: ./.github/workflows/test.yml
77

8+
build-windows:
9+
needs: run-tests
10+
runs-on: windows-2025
811
steps:
912
- name: Checkout code
1013
uses: actions/checkout@v4
1114
with:
1215
submodules: recursive
16+
17+
- uses: ./.github/actions/common-windows
18+
with:
19+
config-preset: Release
20+
build-preset: Release
1321

14-
- name: Configure PartStacker
15-
run: |
16-
cmake --preset Release -G "Visual Studio 17 2022" -A x64
17-
18-
- name: Build PartStacker
19-
run: |
20-
cmake --build --preset Release -j8
21-
copy ".\bin\Release\PartStackerGUI.exe" ".\bin\Release\PartStackerGUI-windows.exe"
22+
- name: Copy exe
23+
run: copy ".\bin\Release\PartStackerGUI.exe" ".\bin\Release\PartStackerGUI-windows.exe"
2224

2325
- name: Upload artifacts
2426
uses: actions/upload-artifact@v4
2527
with:
2628
name: PartStackerGUI-windows
2729
path: .\bin\Release\PartStackerGUI-windows.exe
2830

29-
macos:
31+
build-macos:
32+
needs: run-tests
3033
runs-on: macos-15
31-
3234
steps:
3335
- name: Checkout code
3436
uses: actions/checkout@v4
3537
with:
3638
submodules: recursive
37-
38-
- name: Select Xcode version
39-
run: sudo xcode-select -switch /Applications/Xcode_16.3.app
40-
41-
- name: Configure PartStacker
42-
run: |
43-
cmake --preset Release \
44-
-G Xcode \
45-
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
46-
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.6
47-
48-
- name: Build PartStacker
49-
run: cmake --build --preset Release -j8
39+
40+
- uses: ./.github/actions/common-macos
41+
with:
42+
config-preset: Release
43+
build-preset: Release
5044

5145
- name: Package into DMG
5246
run: |

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
workflow_dispatch:
3+
workflow_call:
4+
5+
jobs:
6+
test-windows:
7+
runs-on: windows-2025
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
with:
12+
submodules: recursive
13+
14+
- uses: ./.github/actions/common-windows
15+
with:
16+
config-preset: Debug
17+
build-preset: Tests
18+
19+
- name: Run Tests
20+
run: |
21+
cd ./build/
22+
ctest
23+
24+
test-macos:
25+
runs-on: macos-15
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
31+
32+
- uses: ./.github/actions/common-macos
33+
with:
34+
config-preset: Debug
35+
build-preset: Tests
36+
37+
- name: Run Tests
38+
run: |
39+
cd ./build/
40+
ctest

0 commit comments

Comments
 (0)