yosys/.github/workflows/test.yml

69 lines
1.8 KiB
YAML
Raw Normal View History

2021-03-17 13:32:50 -05:00
name: Build and run tests
on: [push, pull_request]
jobs:
2021-03-28 14:28:23 -05:00
test:
strategy:
matrix:
runner:
- ubuntu-20.04
- macOS-10.15
runs-on: ${{ matrix.runner }}
2021-03-17 13:32:50 -05:00
steps:
- uses: actions/checkout@v2
2021-03-28 14:28:23 -05:00
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
2021-03-17 13:32:50 -05:00
run: |
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
2021-03-28 14:28:23 -05:00
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
2021-03-17 13:32:50 -05:00
run: |
2021-03-28 14:28:23 -05:00
brew update
brew tap Homebrew/bundle
brew bundle
2021-03-17 13:32:50 -05:00
2021-03-28 14:28:23 -05:00
- name: Setup environment (Linux)
if: runner.os == 'Linux'
2021-03-17 13:32:50 -05:00
run: |
2021-03-28 14:28:23 -05:00
echo "procs=$(nproc)" >> $GITHUB_ENV
2021-03-17 13:32:50 -05:00
2021-03-28 14:28:23 -05:00
- name: Setup environment (macOS)
if: runner.os == 'macOS'
2021-03-17 13:32:50 -05:00
run: |
2021-03-28 14:28:23 -05:00
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
2021-03-17 13:32:50 -05:00
- name: Get iverilog
run: |
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
2021-03-28 14:28:23 -05:00
make -j${{ env.procs }}
2021-03-17 13:32:50 -05:00
make install
- name: Build yosys
run: |
2021-03-28 14:28:23 -05:00
make -j${{ env.procs }}
2021-03-17 13:32:50 -05:00
- name: Run tests
run: |
2021-03-28 14:28:23 -05:00
PATH=$PWD/iverilog-bin/bin:$PATH make -j${{ env.procs }} test