@@ -21,11 +21,11 @@ on: [push, pull_request]
2121jobs :
2222
2323 Run-tests :
24- runs-on : ubuntu-20.04
25-
24+ runs-on : ${{ matrix.os }}
2625 strategy :
2726 fail-fast : false
2827 matrix :
28+ os : [ubuntu-20.04, macos-11]
2929 plugin :
3030 - fasm
3131 - xdc
@@ -41,40 +41,110 @@ jobs:
4141
4242 steps :
4343
44- - uses : actions/checkout@v2
44+ - uses : actions/checkout@v4
4545 with :
4646 submodules : recursive
4747
48- - uses : actions/setup-python@v2
48+ - uses : actions/setup-python@v4
49+ with :
50+ python-version : ' 3.9'
4951
50- - name : Install
52+ - name : Install Ubuntu Dependencies
5153 run : |
5254 sudo apt-get update
5355 sudo apt-get install git g++-9 build-essential bison flex \
5456 libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \
5557 pkg-config libboost-system-dev libboost-python-dev \
56- libboost-filesystem-dev zlib1g-dev clang-format-8 cmake
58+ libboost-filesystem-dev zlib1g-dev clang-format-8 cmake \
59+ nlohmann-json3-dev iverilog
60+ if : ${{ runner.os != 'macOS'}}
61+
62+ - name : Setup homebrew cache
63+ uses : actions/cache@v3
64+ with :
65+ path : |
66+ ~/Library/Caches/Homebrew/boost--*
67+ ~/Library/Caches/Homebrew/downloads/*--boost-*
68+ key : brew-${{ hashFiles('cpp/perspective/CMakeLists.txt') }}
69+ restore-keys : brew-
70+ if : ${{ runner.os == 'macOS' }}
71+
72+ - uses : actions/setup-java@v3
73+ with :
74+ distribution : ' temurin'
75+ java-version : ' 11'
76+ if : ${{ matrix.plugin == 'systemverilog'}}
77+
78+ - name : Install Mac Dependencies
79+ run : |
80+ brew update
81+ brew install bison boost ccache cmake flex graphviz icarus-verilog make nlohmann-json
82+ sudo ln -s /usr/local/bin/gmake /usr/local/bin/make
83+ env :
84+ HOMEBREW_NO_AUTO_UPDATE : " 1"
85+ if : ${{ runner.os == 'macOS'}}
5786
5887 - name : Format
5988 run : source .github/workflows/format-check.sh
6089 env :
6190 OS : ${{ runner.os }}
91+ if : ${{ runner.os != 'macOS'}}
6292
6393 - name : ccache
6494 uses : hendrikmuhs/ccache-action@v1
95+ with :
96+ key : ccache-${{ matrix.os }}-${{ matrix.plugin }}
6597
66- - name : Install Yosys
98+ - name : Install yosys
6799 run : |
68- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
69- source .github/workflows/setup.sh
100+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
101+ set -ex
102+
103+ git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17
104+ pushd yosys
105+ make CONFIG=gcc -j`nproc` && sudo make CONFIG=gcc install
106+ if : ${{ runner.os != 'macOS' }}
107+
108+ - name : Install yosys
109+ run : |
110+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
111+ set -ex
112+
113+ git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17
114+ pushd yosys
115+ make -j`nproc` && sudo make install
116+ if : ${{ runner.os == 'macOS' }}
117+
118+ - name : Install Googletest
119+ run : |
120+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
121+ set -ex
122+
123+ git clone --branch release-1.8.1 https://github.com/google/googletest.git
124+ pushd googletest
125+ cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 . && cmake --build build && sudo cmake --install build
126+ popd
127+
128+ - name : Install Surelog
129+ run : |
130+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
131+ set -ex
132+
133+ python -m pip install -vvv orderedmultidict
134+
135+ git clone https://github.com/chipsalliance/Surelog.git -b v1.70
136+ pushd Surelog
137+ git submodule update --init --recursive
138+ cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DSURELOG_USE_HOST_GTEST=ON -DPYTHON_EXECUTABLE=`which python` -DPython3_EXECUTABLE=`which python` -S . && cmake --build build && sudo cmake --install build
139+ popd
70140 env :
71141 OS : ${{ runner.os }}
142+ if : ${{ matrix.plugin == 'systemverilog'}}
72143
73144 - name : Build and test plugins
74145 run : |
75146 export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
76- source env/conda/bin/activate yosys-plugins
77- source .github/workflows/build-and-test.sh
147+ .github/workflows/build-and-test.sh
78148 env :
79149 OS : ${{ runner.os }}
80150 PLUGIN_NAME : ${{ matrix.plugin }}
87157 contents : write
88158
89159 steps :
90- - uses : actions/checkout@v2
160+ - uses : actions/checkout@v4
91161 with :
92162 fetch-depth : 0
93163 token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments