From 7f6d4ac3596a54b80a4d46dec4b549710b6d2cfb Mon Sep 17 00:00:00 2001 From: Yutetsu TAKATSUKASA Date: Sat, 5 Dec 2020 12:36:04 +0900 Subject: [PATCH] Use both gcc and clang in CI (#2667) * Remove remaining TRAVIS_ variable * Use both gcc and clang. --- .github/workflows/build.yml | 30 ++++++++++++++++++++---------- ci/ci-ccache-maint.bash | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf4ab2f60..c4ab570cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,15 +11,28 @@ on: jobs: vlt: - runs-on: ubuntu-20.04 - name: build and test + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + compiler: [clang, gcc] + include: + - compiler: clang + cc: clang + cxx: clang++ + - compiler: gcc + cc: gcc + cxx: g++ + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }}-${{ matrix.compiler }}-build-test env: CI_OS_NAME: linux + CI_COMMIT: ${{ github.sha }} CCACHE_COMPRESS: 1 CCACHE_DIR: ${{ github.workspace }}/.ccache - CCACHE_MAXSIZE: 4Gi - CC: ccache gcc - CXX: ccache g++ + CCACHE_MAXSIZE: 2Gi # 2GiB for clang and gcc, 4GiB in total + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} steps: - name: Checkout uses: actions/checkout@v2 @@ -29,12 +42,9 @@ jobs: cache-name: ccache with: path: ${{ github.workspace }}/.ccache - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }}-${{ github.sha }} + key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ env.cache-name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - + ${{ matrix.os }}-${{ matrix.compiler }}-${{ env.cache-name }} - name: Install packages for build env: CI_BUILD_STAGE_NAME: build diff --git a/ci/ci-ccache-maint.bash b/ci/ci-ccache-maint.bash index f12fadb35..0c0cf00e6 100755 --- a/ci/ci-ccache-maint.bash +++ b/ci/ci-ccache-maint.bash @@ -19,7 +19,7 @@ set -x ccache --version # Flush ccache if requested in commit message -COMMIT="${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}" +COMMIT="${CI_PULL_REQUEST_SHA:-$CI_COMMIT}" if git log --format=%B -n 1 "$COMMIT" | grep -q -i '\[CI\s\+ccache\s\+clear\]'; then echo "Flushing ccache due to commit message" ccache -C