-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (120 loc) · 3.42 KB
/
pawn-tests.yaml
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
name: Build and test pawn
on:
push:
branches:
- main
- ci
pull_request:
branches:
- main
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
strategy:
fail-fast: false
matrix:
config:
- name: "Ubuntu Latest - GCC"
os: ubuntu-latest
cc: gcc
cxx: g++
shell: bash
- name: "Ubuntu Latest - Clang"
os: ubuntu-latest
cc: clang
cxx: clang++
shell: bash
- name: "Ubuntu 20.04 - GCC"
os: ubuntu-20.04
cc: gcc
cxx: g++
shell: bash
- name: "Ubuntu 20.04 - Clang"
os: ubuntu-20.04
cc: clang
cxx: clang++
shell: bash
- name: "MacOS - GCC 11"
os: macos-latest
cc: gcc-11
cxx: g++-11
shell: bash
- name: "MacOS - Clang"
os: macos-latest
cc: clang
cxx: clang++
shell: bash
- name: "Windows 2022 - GCC"
os: windows-2022
cc: gcc
cxx: g++
sys: mingw64
packages: mingw-w64-x86_64-gcc
shell: msys2 {0}
- name: "Windows 2022 - Clang"
os: windows-2022
cc: clang
cxx: clang++
sys: mingw64
packages: mingw-w64-x86_64-clang mingw-w64-x86_64-lld
shell: msys2 {0}
defaults:
run:
shell: ${{ matrix.config.shell }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare Windows with MSYS2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.config.sys}}
install: make git diffutils ${{matrix.config.packages}}
- name: Fetch bench signature
run: |
git log HEAD | grep 'Bench: ' | head -n 1 | awk '{print $2}' > bench.sig_ref
- name: Build pawn
run: |
make -j4
- name: Run bench
run: |
build/pawn bench > bench.out 2>&1
cat bench.out
- name: Extract and verify bench signature
run: |
cat bench.out | grep 'Nodes searched:' | awk '{print $3}' > bench.sig
cmp bench.sig bench.sig_ref
- name: Run bench - debug build
run: |
make -B -j4 DEBUG=1
build/pawn bench
- name: Run bench - AddressSanitizer
run: |
make -B -j4 DEBUG=2 SANITIZE=address
build/pawn bench
- name: Run bench - UndefinedBehaviorSanitizer
run: |
make -B -j4 DEBUG=2 SANITIZE=undefined
build/pawn bench
- name: Run bench - ThreadSanitizer
run: |
make -B -j4 DEBUG=2 SANITIZE=thread
TSAN_OPTIONS="suppressions=test/suppressions.tsan" build/pawn bench 13 4 16
- name: Run small bench - valgrind (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install valgrind
make -B -j4 DEBUG=2
valgrind --leak-check=full build/pawn bench 10
- name: Run internal tests
run: |
build/pawn test > test.out
cat test.out
grep -q 'All tests passed' test.out