ci: Use aminya/setup-cpp

This commit is contained in:
Krystine Sherwin 2024-03-04 11:37:25 +13:00
parent 326d802220
commit 616848b773
No known key found for this signature in database
1 changed files with 5 additions and 25 deletions

View File

@ -28,9 +28,8 @@ jobs:
needs: pre_job needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
env: env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}
CXXSTD: ${{ matrix.cpp_std }} CXXSTD: ${{ matrix.cpp_std }}
CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}}
strategy: strategy:
matrix: matrix:
os: os:
@ -77,29 +76,10 @@ jobs:
run: | run: |
brew install bison flex gawk libffi pkg-config bash brew install bison flex gawk libffi pkg-config bash
- name: Setup GCC - name: Setup Cpp
if: startsWith(matrix.compiler, 'gcc') uses: aminya/setup-cpp@v1
shell: bash with:
run: | compiler: ${{ matrix.compiler }}
CXX=${CC/#gcc/g++}
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install $CC $CXX
echo "CXX=$CXX" >> $GITHUB_ENV
echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV
- name: Setup Clang
if: startsWith(matrix.compiler, 'clang') && (matrix.compiler != 'clang')
shell: bash
run: |
wget https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.key
rm llvm-snapshot.gpg.key
sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os_name }}/ llvm-toolchain-${{ matrix.os_name }} main"
sudo apt-get update
CXX=${CC/#clang/clang++}
sudo apt-get install $CC $CXX
echo "CXX=$CXX" >> $GITHUB_ENV
- name: Linux runtime environment - name: Linux runtime environment
if: runner.os == 'Linux' if: runner.os == 'Linux'