diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 5016b04c1b8..754ad92a024 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -11,6 +11,9 @@ on: jobs: build-linux: runs-on: ${{ matrix.os.id }} + env: + CC: ${{ matrix.compiler }} + CXXSTD: ${{ matrix.cpp_std }} strategy: matrix: os: @@ -36,11 +39,8 @@ jobs: sudo apt-add-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install $CC $CXX - echo "CC=$CC" >> $GITHUB_ENV echo "CXX=$CXX" >> $GITHUB_ENV echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV - env: - CC: ${{ matrix.compiler }} - name: Setup Clang if: startsWith(matrix.compiler, 'clang') @@ -53,18 +53,12 @@ jobs: sudo apt-get update CXX=${CC/#clang/clang++} sudo apt-get install $CC $CXX - echo "CC=$CC" >> $GITHUB_ENV echo "CXX=$CXX" >> $GITHUB_ENV - env: - CC: ${{ matrix.compiler }} - name: Runtime environment shell: bash - env: - WORKSPACE: ${{ github.workspace }} run: | - echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV - echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV - name: Tool versions @@ -82,7 +76,7 @@ jobs: mkdir build cd build make -f ../Makefile config-${CC%%-*} - make -f ../Makefile -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC + make -f ../Makefile -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CC LD=$CC - name: Compress build shell: bash @@ -102,6 +96,8 @@ jobs: name: Run tests needs: build-linux runs-on: ${{ matrix.os.id }} + env: + CC: clang strategy: matrix: os: @@ -124,16 +120,12 @@ jobs: sudo apt-get update CXX=${CC/#clang/clang++} sudo apt-get install $CC $CXX - echo "CC=$CC" >> $GITHUB_ENV echo "CXX=$CXX" >> $GITHUB_ENV - name: Runtime environment shell: bash - env: - WORKSPACE: ${{ github.workspace }} run: | - echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV - echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV - name: Checkout Yosys @@ -158,11 +150,11 @@ jobs: if: steps.cache-iverilog.outputs.cache-hit != 'true' shell: bash run: | - mkdir -p $GITHUB_WORKSPACE/.local/ + mkdir -p ${{ github.workspace }}/.local/ cd iverilog autoconf - CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local - make -j${{ env.procs }} + CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local + make -j$procs make install - name: Download build artifact