-
Notifications
You must be signed in to change notification settings - Fork 896
101 lines (91 loc) · 2.69 KB
/
test-compile.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
name: Compiler testing
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test-compile:
runs-on: ${{ matrix.os }}
env:
CXXSTD: ${{ matrix.cpp_std }}
CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}}
strategy:
matrix:
os:
- ubuntu-20.04
compiler:
- 'clang-12'
- 'gcc-11'
cpp_std:
- 'c++11'
- 'c++14'
- 'c++17'
- 'c++20'
include:
# Add os_name
- os: ubuntu-20.04
os_name: focal
# macOS builds
- os: macos-13
compiler: 'clang'
cpp_std: 'c++11'
- os: macos-13
compiler: 'clang'
cpp_std: 'c++17'
# Limited testing for older compilers
- os: ubuntu-20.04
os_name: focal
compiler: 'clang-11'
cpp_std: 'c++11'
- os: ubuntu-20.04
os_name: focal
compiler: 'gcc-10'
cpp_std: 'c++11'
fail-fast: false
steps:
- name: Install Linux Dependencies
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- name: Install macOS Dependencies
if: runner.os == 'macOS'
run: |
brew install bison flex gawk libffi pkg-config bash
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
- name: Linux runtime environment
if: runner.os == 'Linux'
shell: bash
run: |
echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
echo "procs=$(nproc)" >> $GITHUB_ENV
- name: macOS runtime environment
if: runner.os == 'macOS'
shell: bash
run: |
echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
- name: Tool versions
shell: bash
run: |
$CC --version
$CXX --version
- name: Checkout Yosys
uses: actions/checkout@v4
- name: Build
shell: bash
run: |
make config-${CC%%-*}
make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC
- name: Log yosys-config output
run: |
./yosys-config || true