Skip to content

Commit 43afccc

Browse files
committed
Split GitHub Actions builds
Adding pr.yml for Pull Request
1 parent 257d829 commit 43afccc

File tree

5 files changed

+150
-123
lines changed

5 files changed

+150
-123
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -6,132 +6,14 @@ on:
66

77
jobs:
88
POSIX-Build:
9-
runs-on: ${{ matrix.config.os }}
10-
name: ${{ matrix.config.name }}
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
config:
15-
- { name: 'Linux', os: 'ubuntu-latest', setup: '.ci/setup-ubuntu.sh' }
16-
- { name: 'macOS', os: 'macos-latest', setup: '.ci/setup-macos.sh' }
17-
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v4
20-
with:
21-
path: target
22-
- name: Install dependencies
23-
run: |
24-
bash "target/${{ matrix.config.setup }}" "sudo"
25-
mkdir current_sagittarius
26-
- name: Install current sagittarius
27-
working-directory: current_sagittarius
28-
run: |
29-
bash ../target/.ci/build-current.sh 'yes'
30-
- name: Pre-build
31-
working-directory: target
32-
run: |
33-
./dist.sh gen
34-
cmake .
35-
- name: Build
36-
working-directory: target
37-
run: make
38-
- name: Test
39-
working-directory: target
40-
run: ctest --output-on-failure -j8
9+
uses: ./.github/workflows/posix-build.yml
4110

4211
VMActions-Build:
4312
needs: POSIX-Build
44-
runs-on: ubuntu-latest
45-
name: ${{ matrix.config.name }} - ${{ matrix.arch }}
46-
strategy:
47-
fail-fast: false
48-
matrix:
49-
arch:
50-
- x86_64
51-
# - aarch64
52-
config:
53-
- { name: 'freebsd', setup: '.ci/setup-freebsd.sh' }
54-
- { name: 'openbsd', setup: '.ci/setup-openbsd.sh' }
55-
steps:
56-
- uses: actions/checkout@v4
57-
- name: Setup VM
58-
uses: jenseng/dynamic-uses@v1
59-
with:
60-
uses: vmactions/${{ matrix.config.name }}-vm@v1
61-
with: |
62-
{
63-
"arch": ${{ toJSON(matrix.arch) }},
64-
"sync": "nfs"
65-
}
66-
- name: Install dependencies / current
67-
uses: ktakashi/dynamic-shell@v1
68-
with:
69-
shell: "${{ matrix.config.name }} {0}"
70-
run: |
71-
cd $GITHUB_WORKSPACE;
72-
sh "./${{ matrix.config.setup }}"
73-
bash "./.ci/build-current.sh"
74-
- name: Pre-build
75-
uses: ktakashi/dynamic-shell@v1
76-
with:
77-
shell: "${{ matrix.config.name }} {0}"
78-
run: |
79-
cd $GITHUB_WORKSPACE;
80-
./dist.sh gen
81-
cmake .
82-
- name: Build
83-
uses: ktakashi/dynamic-shell@v1
84-
with:
85-
shell: "${{ matrix.config.name }} {0}"
86-
run: |
87-
cd $GITHUB_WORKSPACE;
88-
make
89-
- name: Test
90-
uses: ktakashi/dynamic-shell@v1
91-
with:
92-
shell: "${{ matrix.config.name }} {0}"
93-
run: |
94-
cd $GITHUB_WORKSPACE;
95-
ctest --output-on-failure -j2
96-
13+
uses: ./.github/workflows/vmactions-build.yml
14+
9715
Windows-Build:
98-
runs-on: ${{ matrix.images }}
99-
name: ${{ matrix.images }} - ${{ matrix.arch }}
100-
strategy:
101-
fail-fast: false
102-
matrix:
103-
arch: [x64, x86]
104-
images: [windows-2022, windows-2025]
105-
steps:
106-
- name: Checkout
107-
uses: actions/checkout@v4
108-
with:
109-
path: target
110-
- name: Install current sagittarius
111-
working-directory: target
112-
run: |
113-
.\.ci\install-current.ps1
114-
shell: powershell
115-
- name: Setup MSVC
116-
uses: TheMrMilchmann/setup-msvc-dev@v3
117-
with:
118-
arch: ${{ matrix.arch }}
119-
- name: Pre build
120-
working-directory: target
121-
run: dist.bat gen
122-
shell: cmd
123-
- name: CMake
124-
working-directory: target
125-
run: cmake . -G "Ninja" -DSKIP_TEST_VECTOR=ON
126-
shell: cmd
127-
- name: Build
128-
working-directory: target
129-
run: ninja
130-
shell: cmd
131-
- name: Test
132-
working-directory: target
133-
run: ctest --output-on-failure -LE json
134-
shell: cmd
16+
uses: ./.github/workflows/windows-build.yml
13517

13618
Create-Artifact:
13719
needs: [POSIX-Build, Windows-Build]
@@ -147,4 +29,3 @@ jobs:
14729
artifact-id: ${{ needs.Create-Artifact.outputs.artifact-id }}
14830
tar-file: ${{ needs.Create-Artifact.outputs.tar-file }}
14931
suffix: ${{ github.run_id }}
150-

.github/workflows/posix-build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: POSIX Build
2+
on: workflow_call
3+
4+
jobs:
5+
POSIX-Build:
6+
runs-on: ${{ matrix.config.os }}
7+
name: ${{ matrix.config.name }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
config:
12+
- { name: 'Linux', os: 'ubuntu-latest', setup: '.ci/setup-ubuntu.sh' }
13+
- { name: 'macOS', os: 'macos-latest', setup: '.ci/setup-macos.sh' }
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
path: target
19+
- name: Install dependencies
20+
run: |
21+
bash "target/${{ matrix.config.setup }}" "sudo"
22+
mkdir current_sagittarius
23+
- name: Install current sagittarius
24+
working-directory: current_sagittarius
25+
run: |
26+
bash ../target/.ci/build-current.sh 'yes'
27+
- name: Pre-build
28+
working-directory: target
29+
run: |
30+
./dist.sh gen
31+
cmake .
32+
- name: Build
33+
working-directory: target
34+
run: make
35+
- name: Test
36+
working-directory: target
37+
run: ctest --output-on-failure -j8

.github/workflows/pr.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Sagittarius PR build
2+
on:
3+
pull_requests:
4+
branches: [ master ]
5+
6+
jobs:
7+
POSIX-Build:
8+
uses: ./.github/workflows/posix-build.yml
9+
Windows-Build:
10+
uses: ./.github/workflows/windows-build.yml
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Builds using VM Actions
2+
on: workflow_call
3+
4+
jobs:
5+
VMActions-Build:
6+
runs-on: ubuntu-latest
7+
name: ${{ matrix.config.name }} - ${{ matrix.arch }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
arch:
12+
- x86_64
13+
# - aarch64
14+
config:
15+
- { name: 'freebsd', setup: '.ci/setup-freebsd.sh' }
16+
- { name: 'openbsd', setup: '.ci/setup-openbsd.sh' }
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup VM
20+
uses: jenseng/dynamic-uses@v1
21+
with:
22+
uses: vmactions/${{ matrix.config.name }}-vm@v1
23+
with: |
24+
{
25+
"arch": ${{ toJSON(matrix.arch) }},
26+
"sync": "nfs"
27+
}
28+
- name: Install dependencies / current
29+
uses: ktakashi/dynamic-shell@v1
30+
with:
31+
shell: "${{ matrix.config.name }} {0}"
32+
run: |
33+
cd $GITHUB_WORKSPACE;
34+
sh "./${{ matrix.config.setup }}"
35+
bash "./.ci/build-current.sh"
36+
- name: Pre-build
37+
uses: ktakashi/dynamic-shell@v1
38+
with:
39+
shell: "${{ matrix.config.name }} {0}"
40+
run: |
41+
cd $GITHUB_WORKSPACE;
42+
./dist.sh gen
43+
cmake .
44+
- name: Build
45+
uses: ktakashi/dynamic-shell@v1
46+
with:
47+
shell: "${{ matrix.config.name }} {0}"
48+
run: |
49+
cd $GITHUB_WORKSPACE;
50+
make
51+
- name: Test
52+
uses: ktakashi/dynamic-shell@v1
53+
with:
54+
shell: "${{ matrix.config.name }} {0}"
55+
run: |
56+
cd $GITHUB_WORKSPACE;
57+
ctest --output-on-failure -j2
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Windows Build
2+
on: workflow_call
3+
4+
jobs:
5+
Windows-Build:
6+
runs-on: ${{ matrix.images }}
7+
name: ${{ matrix.images }} - ${{ matrix.arch }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
arch: [x64, x86]
12+
images: [windows-2022, windows-2025]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
path: target
18+
- name: Install current sagittarius
19+
working-directory: target
20+
run: |
21+
.\.ci\install-current.ps1
22+
shell: powershell
23+
- name: Setup MSVC
24+
uses: TheMrMilchmann/setup-msvc-dev@v3
25+
with:
26+
arch: ${{ matrix.arch }}
27+
- name: Pre build
28+
working-directory: target
29+
run: dist.bat gen
30+
shell: cmd
31+
- name: CMake
32+
working-directory: target
33+
run: cmake . -G "Ninja" -DSKIP_TEST_VECTOR=ON
34+
shell: cmd
35+
- name: Build
36+
working-directory: target
37+
run: ninja
38+
shell: cmd
39+
- name: Test
40+
working-directory: target
41+
run: ctest --output-on-failure -LE json
42+
shell: cmd

0 commit comments

Comments
 (0)