diff options
author | Zachary Snow <zach@zachjs.com> | 2021-03-28 15:28:23 -0400 |
---|---|---|
committer | Zachary Snow <zachary.j.snow@gmail.com> | 2021-03-28 18:29:29 -0400 |
commit | e314a05e0a7337a55f4d2608c310e918d571326f (patch) | |
tree | 623370ebaf3f07ad6fd9713cb836829115e0d046 /.github/workflows | |
parent | d6d5c2ef342240bd8adb925055667d140cb8dd29 (diff) | |
download | yosys-e314a05e0a7337a55f4d2608c310e918d571326f.tar.gz yosys-e314a05e0a7337a55f4d2608c310e918d571326f.tar.bz2 yosys-e314a05e0a7337a55f4d2608c310e918d571326f.zip |
gha: combine jobs using matrix
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/test.yml | 67 |
1 files changed, 24 insertions, 43 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 401589cd8..d83cff5cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,57 +3,40 @@ name: Build and run tests on: [push, pull_request] jobs: - test-linux: - runs-on: ubuntu-latest + test: + strategy: + matrix: + runner: + - ubuntu-20.04 + - macOS-10.15 + runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v2 - - name: Install dependencies + - name: Install dependencies (Linux) + if: runner.os == 'Linux' 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 - - 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 - make -j$(nproc) - make install - - - name: Build yosys + - name: Install dependencies (macOS) + if: runner.os == 'macOS' run: | - make -j$(nproc) + brew update + brew tap Homebrew/bundle + brew bundle - - name: Run tests + - name: Setup environment (Linux) + if: runner.os == 'Linux' run: | - PATH=$PWD/iverilog-bin/bin:$PATH make -j$(nproc) test - - test-osx: - runs-on: macos-latest - steps: - - - uses: actions/checkout@v2 + echo "procs=$(nproc)" >> $GITHUB_ENV - - name: Install dependencies + - name: Setup environment (macOS) + if: runner.os == 'macOS' run: | - brew update - brew tap Homebrew/bundle - brew bundle + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - name: Get iverilog run: | @@ -69,19 +52,17 @@ jobs: - name: Build iverilog if: steps.cache-iverilog.outputs.cache-hit != 'true' run: | - export PATH="$(brew --prefix bison)/bin:$PATH" mkdir iverilog-bin cd iverilog autoconf CC=gcc CXX=g++ ./configure --prefix=$PWD/../iverilog-bin - make -j$(sysctl -n hw.ncpu) + make -j${{ env.procs }} make install - name: Build yosys run: | - export PATH="$(brew --prefix bison)/bin:$PATH" - make -j$(sysctl -n hw.ncpu) + make -j${{ env.procs }} - name: Run tests 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 |