From c6b88559307ccc2e305e9d21030a2a1e99215b64 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Wed, 24 Jan 2024 18:59:13 -0500 Subject: [PATCH] fix CI to force gcc 13 --- .github/workflows/ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a798e4b..8a9fa22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: TerminalImageViewer CI +name: Build and run on: push: @@ -8,14 +8,20 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apt-get install -qy imagemagick + - name: Validate gcc version + run: | + if [[ $(gcc --version | awk '/gcc/ && ($3+0)>13{print "gcc-13+"}') != "gcc-13+" ]]; then + # Script courtesy of https://stackoverflow.com/a/67791068/16134571 + sudo apt install gcc-13 g++-13 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13 --slave /usr/bin/gcov gcov /usr/bin/gcov-13 + sudo update-alternatives --set gcc /usr/bin/gcc-13 + fi - name: Build run: make -C src - name: Test