@@ -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,109 @@ 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 install bison boost ccache cmake flex graphviz icarus-verilog make nlohmann-json
81+ sudo ln -s /usr/local/bin/gmake /usr/local/bin/make
82+ env :
83+ HOMEBREW_NO_AUTO_UPDATE : " 1"
84+ if : ${{ runner.os == 'macOS'}}
5785
5886 - name : Format
5987 run : source .github/workflows/format-check.sh
6088 env :
6189 OS : ${{ runner.os }}
90+ if : ${{ runner.os != 'macOS'}}
6291
6392 - name : ccache
6493 uses : hendrikmuhs/ccache-action@v1
94+ with :
95+ key : ccache-${{ matrix.os }}-${{ matrix.plugin }}
6596
66- - name : Install Yosys
97+ - name : Install yosys
6798 run : |
68- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
69- source .github/workflows/setup.sh
99+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
100+ set -ex
101+
102+ git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17
103+ pushd yosys
104+ make CONFIG=gcc -j`nproc` && sudo make CONFIG=gcc install
105+ if : ${{ runner.os != 'macOS' }}
106+
107+ - name : Install yosys
108+ run : |
109+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
110+ set -ex
111+
112+ git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17
113+ pushd yosys
114+ make -j`nproc` && sudo make install
115+ if : ${{ runner.os == 'macOS' }}
116+
117+ - name : Install Googletest
118+ run : |
119+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
120+ set -ex
121+
122+ git clone --branch release-1.8.1 https://github.com/google/googletest.git
123+ pushd googletest
124+ cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 . && cmake --build build && sudo cmake --install build
125+ popd
126+
127+ - name : Install Surelog
128+ run : |
129+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
130+ set -ex
131+
132+ python -m pip install -vvv orderedmultidict
133+
134+ git clone https://github.com/chipsalliance/Surelog.git -b v1.70
135+ pushd Surelog
136+ git submodule update --init --recursive
137+ 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
138+ popd
70139 env :
71140 OS : ${{ runner.os }}
141+ if : ${{ matrix.plugin == 'systemverilog'}}
72142
73143 - name : Build and test plugins
74144 run : |
75145 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
146+ .github/workflows/build-and-test.sh
78147 env :
79148 OS : ${{ runner.os }}
80149 PLUGIN_NAME : ${{ matrix.plugin }}
87156 contents : write
88157
89158 steps :
90- - uses : actions/checkout@v2
159+ - uses : actions/checkout@v4
91160 with :
92161 fetch-depth : 0
93162 token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments