-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (64 loc) · 1.8 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: coding convention
run: |
sudo apt-get install -q -y clang-format
scripts/check-format.sh
tidy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
# Fetch all history for proper diffing.
fetch-depth: 0
- name: Install cxxopts
run: scripts/install-cxxopts.sh
- name: Install fmt
run: scripts/install-fmt.sh
- name: Install bear
run: sudo apt-get install -q -y bear
- name: Install clang-tidy
run: |
sudo add-apt-repository -y 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -q -y clang-tidy-18
- name: static checks on diff
if: ${{ github.event_name == 'pull_request' }}
run: |
export CLANG_TIDY_DIFF=clang-tidy-diff-18.py
scripts/check-tidy-diff.sh
- name: static checks
if : ${{ github.event_name == 'push' }}
run: |
export CLANG_TIDY=clang-tidy-18
make tidy
test:
runs-on: ubuntu-22.04
strategy:
matrix:
cxx: [g++, clang++]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install QBE
run: scripts/install-qbe.sh
- name: Install cxxopts
run: scripts/install-cxxopts.sh
- name: Install fmt
run: scripts/install-fmt.sh
- name: Install Turnt
run: pip install turnt
- name: Run tests
run: make test CXX=${{ matrix.cxx }}