Simplify action CIs
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
parent
061d9d2f3c
commit
040ed864ba
59
.github/workflows/test.yaml
vendored
59
.github/workflows/test.yaml
vendored
@ -18,21 +18,25 @@ jobs:
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
|
||||
build_and_test:
|
||||
name: Check pre-commit
|
||||
test:
|
||||
name: Run ctests
|
||||
needs: [ pre-commit ]
|
||||
strategy:
|
||||
matrix:
|
||||
toolchain: [ gcc, llvm ]
|
||||
json_version: [ v3.11.2, v3.8.0 ]
|
||||
env:
|
||||
NLOHMANN_JSON_VERSION: ${{ matrix.json_version }}
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/nlohmann/json-ci:v2.4.0
|
||||
needs: [ pre-commit ]
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub."
|
||||
- run: echo "🔎 Branch name is ${{ github.ref }} and repository is ${{ github.repository }}."
|
||||
- name: Clone nlohmann json
|
||||
uses: actions/checkout@master
|
||||
- name: Clone nlohmann json version ${{ matrix.json_version }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: nlohmann/json
|
||||
path: nlohmann-json
|
||||
ref: v3.11.2
|
||||
ref: ${{ matrix.json_version }}
|
||||
# TODO: Move to FetchContent managed
|
||||
- name: Build and install nlohmann json
|
||||
run: |
|
||||
cd nlohmann-json
|
||||
@ -41,38 +45,7 @@ jobs:
|
||||
cd ..
|
||||
- name: Clone json-schema-validator
|
||||
uses: actions/checkout@v3
|
||||
- name: cmake
|
||||
run: cmake -S . -B build
|
||||
- name: build
|
||||
run: cmake --build build --target all -j$(nproc)
|
||||
- name: test
|
||||
run: cd build && ctest
|
||||
build_and_test_min_version:
|
||||
name: Check pre-commit
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/nlohmann/json-ci:v2.4.0
|
||||
needs: [ pre-commit ]
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub."
|
||||
- run: echo "🔎 Branch name is ${{ github.ref }} and repository is ${{ github.repository }}."
|
||||
- name: Clone nlohmann json
|
||||
uses: actions/checkout@master
|
||||
- name: Run CMake ${{ matrix.toolchain }}-ci workflow with nlohmann/json version ${{ matrix.json_version }}
|
||||
uses: lukka/run-cmake@v10.5
|
||||
with:
|
||||
repository: nlohmann/json
|
||||
path: nlohmann-json
|
||||
ref: v3.8.0
|
||||
- name: Build and install nlohmann json
|
||||
run: |
|
||||
cd nlohmann-json
|
||||
cmake -S . -B build
|
||||
cmake --build build --target install -j$(nproc)
|
||||
cd ..
|
||||
- name: Clone json-schema-validator
|
||||
uses: actions/checkout@v3
|
||||
- name: cmake
|
||||
run: cmake -S . -B build
|
||||
- name: build
|
||||
run: cmake --build build --target all -j$(nproc)
|
||||
- name: test
|
||||
run: cd build && ctest
|
||||
workflowPreset: "${{ matrix.toolchain }}-ci"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user