-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (59 loc) · 2.28 KB
/
Copy pathgithub-test.yml
File metadata and controls
60 lines (59 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Tests on pull request
run-name: ${{ github.actor }} is testing a pull request
on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- dev
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release]
config_zip: [ {header_only: OFF, python_bindings: OFF} ]
tardigrade_opt: [OFF, ON]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: MiniConda setup
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Miniforge3
channels: conda-forge,defaults
channel-priority: true
auto-activate-base: false
activate-environment: "test-environment"
- name: Conda environment
shell: bash -el {0}
run: conda install --file environment.txt --yes --channel conda-forge
- name: CMake linter
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash -el {0}
run: gersemi CMakeLists.txt src/ docs/ --check --diff
- name: Configure
shell: bash -el {0}
run: cmake -S . -B build -DTARDIGRADE_MICROMORPHIC_ELEMENT_BUILD_PYTHON_BINDINGS=${{ matrix.config_zip.python_bindings }} -DTARDIGRADE_HEADER_ONLY=${{ matrix.config_zip.header_only }} -DTARDIGRADE_ERROR_TOOLS_OPT=${{ matrix.tardigrade_opt }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: clang-tidy Lint
if: ${{ matrix.os == 'ubuntu-latest'}}
shell: bash -el {0}
run: run-clang-tidy -config-file=.clang-tidy -p build -extra-arg="-mno-sse2"
- name: clang-format Lint
if: ${{ matrix.os == 'ubuntu-latest' && matrix.tardigrade_opt == 'OFF' && matrix.config_zip.header_only == 'OFF' }}
shell: bash -el {0}
run: cmake --build build --target cpp-format-check
- name: Build
shell: bash -el {0}
run: cmake --build build --target all
- name: Test
shell: bash -el {0}
run: conda activate test-environment && ctest --test-dir build -V