From 8bc206928f9c1b269de4b0416fb8a0ee14235f37 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 9 Feb 2024 05:43:10 +1300 Subject: [PATCH] ci: split test build from matrix Allow test suite to run if, for example, the C++20 builds are failing but C++11 are fine. --- .github/workflows/test-build.yml | 75 ++++++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 204174795..853a2b12b 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -23,8 +23,8 @@ jobs: # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' - build-yosys: - name: Build Yosys + test-builds: + name: Compiler testing runs-on: ${{ matrix.os }} needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' @@ -48,11 +48,6 @@ jobs: # Add os_name - os: ubuntu-20.04 os_name: focal - # Build for testing - - os: ubuntu-20.04 - os_name: focal - compiler: 'clang' - cpp_std: 'c++11' # macOS build - os: macos-13 compiler: 'clang' @@ -131,7 +126,71 @@ jobs: with: submodules: true - - name: Build yosys out-of-tree + - name: Build + shell: bash + run: | + make config-${CC%%-*} + make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC + + build-yosys: + name: Reusable Yosys build + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.compiler }} + CXXSTD: ${{ matrix.cpp_std }} + strategy: + matrix: + os: + - ubuntu-20.04 + compiler: + - 'clang' + cpp_std: + - 'c++11' + include: + # Add os_name + - os: ubuntu-20.04 + os_name: focal + fail-fast: false + steps: + - name: Install Linux Dependencies + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install 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: Install macOS Dependencies + if: runner.os == 'macOS' + run: | + brew install bison flex gawk libffi pkg-config bash + + - name: Linux runtime environment + if: runner.os == 'Linux' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "procs=$(nproc)" >> $GITHUB_ENV + + - name: macOS runtime environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + + - name: Tool versions + shell: bash + run: | + $CC --version + $CXX --version + + - name: Checkout Yosys + uses: actions/checkout@v4 + + - name: Build shell: bash run: | mkdir build