Use both gcc and clang in CI (#2667)

* Remove remaining TRAVIS_ variable

* Use both gcc and clang.
This commit is contained in:
Yutetsu TAKATSUKASA 2020-12-05 12:36:04 +09:00 committed by GitHub
parent 666d0ab552
commit 7f6d4ac359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 11 deletions

View File

@ -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

View File

@ -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