mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
gha: combine jobs using matrix
This commit is contained in:
parent
d6d5c2ef34
commit
e314a05e0a
69
.github/workflows/test.yml
vendored
69
.github/workflows/test.yml
vendored
|
@ -3,58 +3,41 @@ name: Build and run tests
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-linux:
|
test:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
runner:
|
||||||
|
- ubuntu-20.04
|
||||||
|
- macOS-10.15
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies (Linux)
|
||||||
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install g++ 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
|
sudo apt-get install g++ 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: Get iverilog
|
- name: Install dependencies (macOS)
|
||||||
run: |
|
if: runner.os == 'macOS'
|
||||||
git clone git://github.com/steveicarus/iverilog.git
|
|
||||||
|
|
||||||
- name: Cache iverilog
|
|
||||||
id: cache-iverilog
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: iverilog-bin
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('iverilog/.git/refs/heads/master') }}
|
|
||||||
|
|
||||||
- name: Build iverilog
|
|
||||||
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
mkdir iverilog-bin
|
|
||||||
cd iverilog
|
|
||||||
autoconf
|
|
||||||
CC=gcc CXX=g++ ./configure --prefix=$PWD/../iverilog-bin
|
|
||||||
make -j$(nproc)
|
|
||||||
make install
|
|
||||||
|
|
||||||
- name: Build yosys
|
|
||||||
run: |
|
|
||||||
make -j$(nproc)
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
PATH=$PWD/iverilog-bin/bin:$PATH make -j$(nproc) test
|
|
||||||
|
|
||||||
test-osx:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
brew update
|
brew update
|
||||||
brew tap Homebrew/bundle
|
brew tap Homebrew/bundle
|
||||||
brew bundle
|
brew bundle
|
||||||
|
|
||||||
|
- name: Setup environment (Linux)
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
run: |
|
||||||
|
echo "procs=$(nproc)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup environment (macOS)
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
|
||||||
|
echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Get iverilog
|
- name: Get iverilog
|
||||||
run: |
|
run: |
|
||||||
git clone git://github.com/steveicarus/iverilog.git
|
git clone git://github.com/steveicarus/iverilog.git
|
||||||
|
@ -69,19 +52,17 @@ jobs:
|
||||||
- name: Build iverilog
|
- name: Build iverilog
|
||||||
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
export PATH="$(brew --prefix bison)/bin:$PATH"
|
|
||||||
mkdir iverilog-bin
|
mkdir iverilog-bin
|
||||||
cd iverilog
|
cd iverilog
|
||||||
autoconf
|
autoconf
|
||||||
CC=gcc CXX=g++ ./configure --prefix=$PWD/../iverilog-bin
|
CC=gcc CXX=g++ ./configure --prefix=$PWD/../iverilog-bin
|
||||||
make -j$(sysctl -n hw.ncpu)
|
make -j${{ env.procs }}
|
||||||
make install
|
make install
|
||||||
|
|
||||||
- name: Build yosys
|
- name: Build yosys
|
||||||
run: |
|
run: |
|
||||||
export PATH="$(brew --prefix bison)/bin:$PATH"
|
make -j${{ env.procs }}
|
||||||
make -j$(sysctl -n hw.ncpu)
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
PATH=$PWD/iverilog-bin/bin:$PATH make -j$(sysctl -n hw.ncpu) test
|
PATH=$PWD/iverilog-bin/bin:$PATH make -j${{ env.procs }} test
|
||||||
|
|
Loading…
Reference in a new issue