From a39a0c662d6f49a41cdfa5f23f9b5ea521bcd1e6 Mon Sep 17 00:00:00 2001 From: pwisniewskimobica Date: Thu, 27 Jan 2022 15:06:19 +0100 Subject: [PATCH] [workflows] Use GCC 11 in CI builds --- .github/workflows/pre-compile_llvm.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pre-compile_llvm.yml b/.github/workflows/pre-compile_llvm.yml index 0d42b17d0e33..3822564a1a1a 100644 --- a/.github/workflows/pre-compile_llvm.yml +++ b/.github/workflows/pre-compile_llvm.yml @@ -11,18 +11,13 @@ jobs: strategy: matrix: target: [X86] - cc: [clang] - cpp: [clang++] + cc: [clang, gcc] version: [10, 11] - include: - - target: X86 - cc: gcc - cpp: g++ - version: 10 steps: - if: matrix.cc == 'clang' run: | + echo "cpp=clang++" >> $GITHUB_ENV sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa sudo touch /etc/apt/sources.list.d/llvm.list echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list @@ -33,12 +28,15 @@ jobs: - if: matrix.cc == 'gcc' && matrix.version == '10' run: | + echo "cpp=g++" >> $GITHUB_ENV sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa sudo apt install gcc-10 g++-10 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 20 + + - if: matrix.cc == 'gcc' && matrix.version == '11' + run: | + echo "cpp=g++" >> $GITHUB_ENV + sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa + sudo apt install gcc-11 g++-11 - name: Check tools run: | @@ -46,7 +44,7 @@ jobs: cmake --version make --version ${{ matrix.cc }}-${{ matrix.version }} --version - ${{ matrix.cpp }}-${{ matrix.version }} --version + ${{env.cpp}}-${{ matrix.version }} --version - name: Extract branch name run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}" @@ -66,7 +64,7 @@ jobs: -t ${{ matrix.target }} \ -p /usr/local \ -a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} \ - -b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} \ + -b /usr/bin/${{env.cpp}}-${{ matrix.version }} \ -n $(nproc) # Archive the source + build directories for future installation cd ..