@@ -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
@@ -39,40 +39,87 @@ jobs:
3939
4040 steps :
4141
42- - uses : actions/checkout@v2
42+ - uses : actions/checkout@v4
4343 with :
4444 submodules : recursive
4545
46- - uses : actions/setup-python@v2
46+ - uses : actions/setup-python@v4
47+ with :
48+ python-version : ' 3.9'
4749
48- - name : Install
50+ - name : Install Ubuntu Dependencies
4951 run : |
5052 sudo apt-get update
5153 sudo apt-get install git g++-9 build-essential bison flex \
5254 libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \
5355 pkg-config libboost-system-dev libboost-python-dev \
54- libboost-filesystem-dev zlib1g-dev clang-format-8 cmake
56+ libboost-filesystem-dev zlib1g-dev clang-format-8 cmake \
57+ nlohmann-json3-dev iverilog
58+ if : ${{ runner.os != 'macOS'}}
59+
60+ - name : Setup homebrew cache
61+ uses : actions/cache@v3
62+ with :
63+ path : |
64+ ~/Library/Caches/Homebrew/boost--*
65+ ~/Library/Caches/Homebrew/downloads/*--boost-*
66+ key : brew-${{ matrix.os }}
67+ restore-keys : brew-
68+ if : ${{ runner.os == 'macOS' }}
69+
70+ - name : Install Mac Dependencies
71+ run : |
72+ brew install bison boost ccache cmake flex graphviz icarus-verilog make nlohmann-json
73+ sudo ln -s /usr/local/bin/gmake /usr/local/bin/make
74+ env :
75+ HOMEBREW_NO_AUTO_UPDATE : " 1"
76+ if : ${{ runner.os == 'macOS'}}
5577
5678 - name : Format
5779 run : source .github/workflows/format-check.sh
5880 env :
5981 OS : ${{ runner.os }}
82+ if : ${{ runner.os != 'macOS'}}
6083
6184 - name : ccache
6285 uses : hendrikmuhs/ccache-action@v1
86+ with :
87+ key : ccache-${{ matrix.os }}-${{ matrix.plugin }}
6388
64- - name : Install Yosys
89+ - name : Install yosys
6590 run : |
66- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
67- source .github/workflows/setup.sh
68- env :
69- OS : ${{ runner.os }}
91+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
92+ set -ex
93+
94+ git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17
95+ pushd yosys
96+ make CONFIG=gcc -j`nproc` && sudo make CONFIG=gcc install
97+ if : ${{ runner.os != 'macOS' }}
98+
99+ - name : Install yosys
100+ run : |
101+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
102+ set -ex
103+
104+ git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17
105+ pushd yosys
106+ make -j`nproc` && sudo make install
107+ if : ${{ runner.os == 'macOS' }}
108+
109+ - name : Install Googletest
110+ run : |
111+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
112+ set -ex
113+
114+ git clone --branch release-1.8.1 https://github.com/google/googletest.git
115+ pushd googletest
116+ cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 . && cmake --build build && sudo cmake --install build
117+ popd
70118
71119 - name : Build and test plugins
72120 run : |
73121 export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
74- source env/conda/bin/activate yosys-plugins
75- source .github/workflows/build-and-test.sh
122+ .github/workflows/build-and-test.sh
76123 env :
77124 OS : ${{ runner.os }}
78125 PLUGIN_NAME : ${{ matrix.plugin }}
85132 contents : write
86133
87134 steps :
88- - uses : actions/checkout@v2
135+ - uses : actions/checkout@v4
89136 with :
90137 fetch-depth : 0
91138 token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments