-
Notifications
You must be signed in to change notification settings - Fork 243
110 lines (97 loc) · 3.33 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
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
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
build:
name: ${{matrix.name}}
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: gcc-6
cc: gcc-6
cxx: g++-6
os: ubuntu-latest
container: ubuntu:18.04
- name: gcc-13
cc: gcc-13
cxx: g++-13
os: ubuntu-latest
container: ubuntu:24.04
# We need relaxed builds for debug mode with current GCC versions, see #218.
build_options: "relaxed_build=on"
- name: clang-18
cc: clang-18
cxx: clang++-18
os: ubuntu-latest
container: ubuntu:24.04
- name: clang-macOS
cc: clang
cxx: clang++
os: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
if: matrix.name != 'gcc-6'
- name: Checkout (Ubuntu 18.04)
if: matrix.name == 'gcc-6'
# Recent versions of Github's checkout action do not run on older Ubuntu versions because they use a too recent
# Node.js version. Thus, we have to checkout the code manually.
run: |
echo "REPO_URL=$(awk -v a=${github.event.pull_request.head.repo.clone_url} -v b=${github.repositoryUrl} 'BEGIN { if (a == "") { print b } else { print a } }')" >> $GITHUB_ENV
echo $GITHUB_ENV
echo $REPO_URL
apt-get update
apt-get install -y git
git config --global --add safe.directory '*'
git clone "${REPO_URL}" .
git checkout $GITHUB_HEAD_REF
- name: Setup (macOS)
if: matrix.name == 'clang-macOS'
run: |
brew install bison flex
echo "BISON=$(brew --prefix bison)/bin/bison" >> $GITHUB_ENV
echo "FLEX=$(brew --prefix flex)/bin/flex" >> $GITHUB_ENV
- name: Setup (Ubuntu)
if: matrix.name != 'clang-macOS'
run: |
apt-get update
apt-get install --no-install-recommends -y bison flex ${CC} ${CXX} make valgrind
echo "BISON=bison" >> $GITHUB_ENV
echo "FLEX=flex" >> $GITHUB_ENV
- name: System Information
run: |
awk -v a=$(uname) 'BEGIN { a == "Linux" ? system("cat /etc/issue") : system("sw_vers") }'
${CC} --version
${CXX} --version
${BISON} --version
${FLEX} --version
awk -v a=$(uname) 'BEGIN { if (a == "Linux") system("valgrind --version") }'
- name: Build Parser
run: |
make -j $(nproc)
BISON=${BISON} FLEX=${FLEX} make test
make test_example
- name: Build Parser and Lexer from Scratch
run: |
BISON=${BISON} FLEX=${FLEX} make cleanall
BISON=${BISON} FLEX=${FLEX} make -j $(nproc)
BISON=${BISON} FLEX=${FLEX} make test
make test_example
- name: Build Parser and Lexer from Scratch (Debug)
run: |
BISON=${BISON} FLEX=${FLEX} make cleanall
BISON=${BISON} FLEX=${FLEX} make -j $(nproc) mode=debug ${{matrix.build_options}}
BISON=${BISON} FLEX=${FLEX} make test
make test_example