-
Notifications
You must be signed in to change notification settings - Fork 23
61 lines (57 loc) · 1.93 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
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
name: test ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
windows-latest,
# macos-latest, # cppfront is currently broken on AppleClang
ubuntu-latest,
]
runs-on: ${{ matrix.os }}
steps:
# System set-up
- uses: actions/checkout@v3
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
- uses: lukka/get-cmake@latest
- name: Install GCC 11
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y gcc-11 g++-11
echo "CC=gcc-11" >> $GITHUB_ENV
echo "CXX=g++-11" >> $GITHUB_ENV
# Main cppfront library
- name: Configure cppfront
run: cmake -G Ninja -S . -B build/cppfront -DCMAKE_BUILD_TYPE=Release
- name: Build cppfront
run: cmake --build build/cppfront --config Release
- name: Install cppfront locally
run: cmake --install build/cppfront --config Release --prefix _local
# Regression tests
- name: Configure regression tests
run: >
cmake -G Ninja -S regression-tests -B build/regression-tests -DCMAKE_BUILD_TYPE=Release
"-DCMAKE_PREFIX_PATH=${{github.workspace}}/_local"
- name: Build regression tests
run: cmake --build build/regression-tests --config Release
- name: Run regression tests
run: ctest --output-on-failure -C Release -j 2
working-directory: build/regression-tests
# Example
- name: Configure example
run: >
cmake -G Ninja -S example -B build/example -DCMAKE_BUILD_TYPE=Release
"-DCMAKE_PREFIX_PATH=${{github.workspace}}/_local"
- name: Build example
run: cmake --build build/example --config Release
- name: Run example
run: ./build/example/main && cmake -E cat xyzzy