-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (88 loc) · 2.73 KB
/
ci.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: ci
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- main
env:
CLANG_TIDY_VERSION: "16"
VERBOSE: 1
jobs:
Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-20.04
- windows-2022
- windows-2019
compiler:
- gcc-11
- llvm-16.0.0
- msvc
generator:
- "Ninja Multi-Config"
build_type:
#- Debug
- Release
developer_mode:
#- ON
- OFF
exclude:
- os: windows-2019
compiler: gcc-11
- os: windows-2019
compiler: msvc
- os: ubuntu-20.04
compiler: msvc
steps:
- name: Check for llvm version mismatches
if: ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')
- uses: actions/checkout@v4
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
developer_mode: ${{ matrix.developer_mode }}
generator: ${{ matrix.generator }}
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
vcpkg: false
ccache: true
clangtidy: ${{ env.CLANG_TIDY_VERSION }}
cppcheck: false
gcovr: false
opencppcoverage: false
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DENABLE_DEVELOPER_MODE:BOOL=${{matrix.developer_mode}} -Dpsim_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DGIT_SHA:STRING=${{ github.sha }}
- name: Build
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: CPack
if: matrix.package_generator != ''
working-directory: ./build
run: |
cpack -C ${{matrix.build_type}} -G ${{matrix.package_generator}}
- name: Publish Tagged Release
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.package_generator != '' }}
with:
files: |
build/*-*${{ matrix.build_type }}*-*.*