Skip to content

Commit

Permalink
test build w different compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Nov 2, 2024
1 parent f78c356 commit 0b07f56
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,35 @@ name: Build and test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: # copy Yosys' test build matrix (w/o macOS)
os:
- ubuntu-latest
compiler:
# oldest supported
- 'clang-14'
- 'gcc-10'
# newest
- 'clang'
- 'gcc'
include:
# oldest clang not available on ubuntu-latest
- os: ubuntu-20.04
compiler: 'clang-10'
runs-on: ${{ matrix.os }}
env:
CC_SHORT: ${{ startsWith(matrix.compiler, 'gcc') && 'gcc' || 'clang' }}
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libfmt-dev
sudo apt-get install -y gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
sudo apt-get install -y gperf cmake build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- name: Setup compiler
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -31,7 +50,7 @@ jobs:
cache-name: cache-yosys
with:
path: tests/third_party/yosys
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.YOSYS_HASH }}-patched
key: ${{ runner.os }}-build-${{ matrix.compiler }}-${{ env.cache-name }}-${{ env.YOSYS_HASH }}-patched
- if: ${{ steps.cache-yosys.outputs.cache-hit != 'true' }}
name: Pull Yosys
run: |
Expand All @@ -41,8 +60,9 @@ jobs:
shell: bash
run: |
cd tests/third_party/yosys
make config-gcc
make config-$CC_SHORT
echo "ENABLE_ABC := 0" >> Makefile.conf
echo "CXXSTD := c++20" >> Makefile.conf
patch -p1 < ../cxxrtl-work-around-issue-3549.patch
make -j6
- name: Install Yosys
Expand All @@ -69,7 +89,7 @@ jobs:
cache-name: cache-slang
with:
path: build/slang_install
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SLANG_HASH }}-${{ env.MAKEFILE_HASH }}
key: ${{ runner.os }}-build-${{ matrix.compiler }}-${{ env.cache-name }}-${{ env.MAKEFILE_HASH }}
- if: ${{ steps.cache-slang.outputs.cache-hit != 'true' }}
name: Pull Slang
run: |
Expand All @@ -81,7 +101,8 @@ jobs:
shell: bash
run: |
tar -cvf build.tar build/slang.so tests/third_party/yosys/
- name: Store build artifact
- if: ${{ matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc' }}
name: Store build artifact
uses: actions/upload-artifact@v4
with:
name: build.tar
Expand Down

0 comments on commit 0b07f56

Please sign in to comment.