1
- name : Build and run tests (Linux)
1
+ name : Build and run tests
2
2
3
3
on :
4
4
pull_request :
9
9
- master
10
10
11
11
jobs :
12
- build-linux :
13
- runs-on : ${{ matrix.os.id }}
12
+ build-yosys :
13
+ runs-on : ${{ matrix.os }}
14
14
env :
15
15
CC : ${{ matrix.compiler }}
16
16
CXX : ${{ matrix.compiler }}
17
17
CXXSTD : ${{ matrix.cpp_std }}
18
18
strategy :
19
19
matrix :
20
20
os :
21
- - { id: ubuntu-20.04, name: focal }
21
+ - ubuntu-20.04
22
+ - macos-13
22
23
compiler :
23
- - ' clang'
24
24
- ' clang-12'
25
25
- ' gcc-11'
26
26
cpp_std :
@@ -29,21 +29,34 @@ jobs:
29
29
- ' c++17'
30
30
- ' c++20'
31
31
include :
32
- # Limit the older compilers to C++11 mode
33
- - os : { id: ubuntu-20.04, name: focal }
32
+ # Build for testing
33
+ - os : ubuntu-20.04
34
+ compiler : ' clang'
35
+ cpp_std : ' c++11'
36
+ # Limited testing for older compilers
37
+ - os : ubuntu-20.04
34
38
compiler : ' clang-11'
35
39
cpp_std : ' c++11'
36
- - os : { id: ubuntu-20.04, name: focal }
40
+ - os : ubuntu-20.04
37
41
compiler : ' gcc-10'
38
42
cpp_std : ' c++11'
43
+ # Add os_name
44
+ - os : ubuntu-20.04
45
+ os_name : focal
39
46
fail-fast : false
40
47
steps :
41
- - name : Install Dependencies
48
+ - name : Install Linux Dependencies
49
+ if : runner.os == 'Linux'
42
50
shell : bash
43
51
run : |
44
52
sudo apt-get update
45
53
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
46
54
55
+ - name : Install macOS Dependencies
56
+ if : runner.os == 'macOS'
57
+ run : |
58
+ brew install bison flex gawk libffi pkg-config bash
59
+
47
60
- name : Setup GCC
48
61
if : startsWith(matrix.compiler, 'gcc')
49
62
shell : bash
@@ -62,18 +75,28 @@ jobs:
62
75
wget https://apt.llvm.org/llvm-snapshot.gpg.key
63
76
sudo apt-key add llvm-snapshot.gpg.key
64
77
rm llvm-snapshot.gpg.key
65
- sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os.name }}/ llvm-toolchain-${{ matrix.os.name }} main"
78
+ sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os_name }}/ llvm-toolchain-${{ matrix.os_name }} main"
66
79
sudo apt-get update
67
80
CXX=${CC/#clang/clang++}
68
81
sudo apt-get install $CC $CXX
69
82
echo "CXX=$CXX" >> $GITHUB_ENV
70
83
71
- - name : Runtime environment
84
+ - name : Linux runtime environment
85
+ if : runner.os == 'Linux'
72
86
shell : bash
73
87
run : |
74
88
echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
75
89
echo "procs=$(nproc)" >> $GITHUB_ENV
76
90
91
+ - name : macOS runtime environment
92
+ if : runner.os == 'macOS'
93
+ shell : bash
94
+ run : |
95
+ echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
96
+ echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
97
+ echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
98
+ echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
99
+
77
100
- name : Tool versions
78
101
shell : bash
79
102
run : |
@@ -101,7 +124,7 @@ jobs:
101
124
if : (matrix.cpp_std == 'c++11') && (matrix.compiler == 'clang')
102
125
uses : actions/upload-artifact@v4
103
126
with :
104
- name : build-artifact
127
+ name : build-${{ matrix.os }}
105
128
path : build.tar
106
129
retention-days : 1
107
130
@@ -159,7 +182,7 @@ jobs:
159
182
- name : Download build artifact
160
183
uses : actions/download-artifact@v4
161
184
with :
162
- name : build-artifact
185
+ name : build-${{ matrix.os }}
163
186
164
187
- name : Uncompress build
165
188
shell : bash
0 commit comments