Skip to content

Commit d94ebf7

Browse files
committed
Update workflows
1 parent f7b7ff7 commit d94ebf7

File tree

3 files changed

+58
-32
lines changed

3 files changed

+58
-32
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Check formatting
17+
run: |
18+
find examples include tests -name '*.cpp' -o -name '*.h' |
19+
xargs clang-format -style=file -i # --dry-run --Werror

.github/workflows/tests.yml

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
name: tests
22

33
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
4+
workflow_call:
5+
inputs:
6+
os:
7+
description: 'Operating system to run the job on (ubuntu-latest, windows-latest, macos-latest)'
8+
required: true
9+
type: string
10+
cxx_compilers:
11+
description: 'List of compilers to use'
12+
required: true
13+
type: string
814

915
jobs:
10-
build:
11-
runs-on: ${{ matrix.os }}
12-
16+
reusable-job:
17+
runs-on: ${{ inputs.os }}
18+
1319
strategy:
1420
fail-fast: true
1521

1622
matrix:
17-
os: [ubuntu-24.04, windows-2022, macos-15]
1823
build_type: [Debug, Release]
19-
cxx_compiler: [g++-14, clang++, cl]
20-
exclude:
21-
- os: windows-2022
22-
cxx_compiler: g++-14
23-
- os: windows-2022
24-
cxx_compiler: clang++
25-
- os: ubuntu-24.04
26-
cxx_compiler: cl
27-
- os: macos-15
28-
cxx_compiler: cl
29-
- os: macos-15
30-
cxx_compiler: g++-14
31-
24+
cxx_compiler: ${{ fromJSON(inputs.compilers) }}
25+
3226
steps:
3327
- name: Checkout
3428
uses: actions/checkout@v4
@@ -51,14 +45,3 @@ jobs:
5145

5246
- name: Run tests
5347
run: ctest --output-on-failure --build-config ${{ matrix.build_type }} --test-dir ${{ steps.strings.outputs.build-output-dir }}
54-
55-
lint:
56-
runs-on: ubuntu-latest
57-
58-
steps:
59-
- uses: actions/checkout@v4
60-
61-
- name: Check formatting
62-
run: |
63-
find examples include tests -name '*.cpp' -o -name '*.h' |
64-
xargs clang-format -style=file -i # --dry-run --Werror

.github/workflows/windows.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: windows
2+
3+
env:
4+
OS: windows-2022
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
tests:
14+
runs-on: ${{ env.OS }}
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Build and run tests
21+
uses: ./.github/workflows/tests.yml
22+
with:
23+
os: ${{ env.OS }}
24+
cxx_compilers: '["cl"]'

0 commit comments

Comments
 (0)