-
Notifications
You must be signed in to change notification settings - Fork 9
137 lines (118 loc) · 4.02 KB
/
build_test.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
129
130
131
132
133
134
135
136
137
name: build_test
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 500M
CCACHE_KEY_SUFFIX: r19
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-22.04, cc: clang, cxx: clang++ }
- { os: ubuntu-22.04, cc: gcc, cxx: g++ }
- { os: macos-12, cc: clang, cxx: clang++ }
- { os: windows-2022 }
- { os: ubuntu-20.04, cc: clang, cxx: clang++ } # TODO remove; but there is no firefox in 22.04 yet
steps:
- name: ubuntu install ccache
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt install ccache
ccache -V
- name: macos install ccache
if: startsWith(matrix.config.os, 'macos')
run: |
brew install ccache
ccache -V
- name: set up python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: install python dependencies
run: pip install --upgrade pip conan==1.*
- name: cache
uses: actions/cache@v2
with:
path: |
~/.ccache
/Users/runner/Library/Caches/ccache
~/.conan/data
C:/.conan
C:/Users/runneradmin/.conan/data
key: ${{ matrix.config.os }}-${{ matrix.config.cxx }}-${{ env.CCACHE_KEY_SUFFIX }}
restore-keys: |
${{ matrix.config.os }}-${{ matrix.config.cxx }}-
- name: checkout
uses: actions/checkout@v2
- name: cmake
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
- name: make
run: |
cd build
cmake --build . --config Release # `config Release` somehow necessary by windows
- name: upload binaries
uses: actions/upload-artifact@v2
with:
name: bin-${{ matrix.config.os }}-${{ matrix.config.cxx }}
path: |
build/test/odr_test
test:
needs: build
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
config:
- { os: ubuntu-20.04, bin: bin-ubuntu-20.04-clang++ }
- { os: macos-12, bin: bin-macos-12-clang++ }
steps:
- name: ubuntu install tidy
if: startsWith(matrix.config.os, 'ubuntu')
run: sudo apt install tidy
- name: macos install tidy
if: startsWith(matrix.config.os, 'macos')
run: brew install tidy-html5
- name: set up python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_ANDIWAND }}
submodules: true
- run: pip install -r test/scripts/requirements.txt
- name: download binaries
uses: actions/download-artifact@v2
with:
name: ${{ matrix.config.bin }}
path: build/test
- name: fix artifact permissions
run: chmod +x build/test/odr_test
- name: test
working-directory: build/test
run: ./odr_test
- name: tidy public test outputs
run: python3 -u test/scripts/tidy_output.py build/test/output/odr-public/output
- name: compare public test outputs
run: python3 -u test/scripts/compare_output.py --driver firefox --max-workers 1 test/data/reference-output/odr-public/output build/test/output/odr-public/output
- name: tidy private test outputs
run: python3 -u test/scripts/tidy_output.py build/test/output/odr-private/output
- name: compare private test outputs
run: python3 -u test/scripts/compare_output.py --driver firefox --max-workers 1 test/data/reference-output/odr-private/output build/test/output/odr-private/output