-
-
Notifications
You must be signed in to change notification settings - Fork 65
128 lines (105 loc) · 3.18 KB
/
commit.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Commit
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test_cli:
runs-on: ${{ matrix.os }}
strategy:
matrix:
name: [linux-gcc-9]
include:
- name: linux-gcc-9
os: ubuntu-22.04
compiler: "gcc"
version: "9"
steps:
- uses: actions/checkout@v2
- name: Install (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
# Install compiler
cc="${{ matrix.compiler }}-${{ matrix.version }}"
cc="${cc%-}"
cxx="${cc/clang/clang++}"
cxx="${cxx/gcc/g++}"
sudo apt-get update
sudo apt-get install -y libtool m4 autoconf
if [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y "${cxx}"
else
sudo apt-get install -y "${cc}"
fi
echo "CC=${cc}" >> $GITHUB_ENV
echo "CXX=${cxx}" >> $GITHUB_ENV
- name: Install bats
if: runner.os == 'Linux'
shell: bash
run: |
# Install bats
git clone https://github.com/sstephenson/bats.git
cd bats
sudo ./install.sh /usr/local
- name: Create Build Environment
shell: bash
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug \
-DPISA_ENABLE_BENCHMARKING=OFF \
-DPISA_ENABLE_TESTING=OFF \
-DPISA_CI_BUILD=ON \
-DPISA_BUILD_TOOLS=ON ..
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Debug -- -j 4
- name: Test CLI
shell: bash
working-directory: ${{runner.workspace}}/build
env:
TEST_DIR: ../pisa/test
run: ../pisa/test/cli/run.sh
coverage:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Bulid docker image
shell: bash
run: docker build -t pisa -f- . < "${{runner.workspace}}/pisa/test/docker/coverage/Dockerfile"
- name: Generate and upload coverage
shell: bash
run: docker run --env CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}" --rm pisa
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install clang-format
shell: bash
run: |
sudo apt-get install -y clang-format-9
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Run clang-format
shell: bash
run: |
wget https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py
python run-clang-format.py \
--clang-format-executable clang-format-9 \
-r src/**/*.cpp include/pisa/**/*.hpp tools/*.cpp tools/*.hpp test/*.cpp
headers:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Bulid docker image
shell: bash
run: docker build -t pisa -f- . < "${{runner.workspace}}/pisa/test/docker/headers/Dockerfile"