Skip to content

Commit de79aea

Browse files
committed
Add basic GitHub actions
Signed-off-by: Cristian Le <[email protected]>
1 parent f311295 commit de79aea

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ master ]
7+
push:
8+
branches: [ master ]
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
tests:
19+
uses: ./.github/workflows/step_test.yaml
20+
21+
pass:
22+
needs: [ tests ]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check all CI jobs
26+
uses: re-actors/alls-green@release/v1
27+
with:
28+
jobs: ${{ toJSON(needs) }}
29+
if: always()

.github/workflows/step_test.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: test
2+
run-name: Run tests
3+
4+
on:
5+
workflow_call:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
tests:
12+
name: Check ${{ matrix.toolchain }}
13+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
14+
container: ${{ !matrix.os && 'ghcr.io/lecrisut/dev-env:main' || '' }}
15+
continue-on-error: ${{ matrix.experimental || false }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
toolchain: [ gcc, llvm, intel, windows, macos ]
20+
include:
21+
- os: windows-latest
22+
toolchain: windows
23+
- os: macos-latest
24+
toolchain: macos
25+
steps:
26+
- name: Enable msvc toolchain on windows
27+
uses: ilammy/msvc-dev-cmd@v1
28+
if: contains(matrix.os, 'windows')
29+
- name: Activate Intel compilers
30+
# Not elegant, it will propagate all environment variable.
31+
# Intel does not provide a way to output the environment variables to a file
32+
# Note: PATH needs to be exported to GITHUB_PATH otherwise it can be overwritten
33+
run: |
34+
source /opt/intel/oneapi/setvars.sh
35+
printenv >> $GITHUB_ENV
36+
echo $PATH >> $GITHUB_PATH
37+
if: matrix.toolchain == 'intel'
38+
- uses: actions/checkout@v4
39+
- uses: lukka/get-cmake@latest
40+
- name: Run CMake configuration for ${{ matrix.toolchain }} toolchain
41+
uses: lukka/[email protected]
42+
with:
43+
workflowPreset: "${{ matrix.toolchain }}-ci"
44+
pass:
45+
needs: [ tests ]
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Check test jobs
49+
uses: re-actors/alls-green@release/v1
50+
with:
51+
jobs: ${{ toJSON(needs) }}
52+
if: always()

0 commit comments

Comments
 (0)