From 23689cc31b890b0d8ef3a00a058ad40a4d0ce439 Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Wed, 6 Jan 2021 02:00:24 +0000 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 99 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aaed628 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,99 @@ +name: Continuous Integration + +on: + push: + branches: + - master + + pull_request: + branches: + - master + +jobs: + clang_tests: + if: >- + ! contains(toJSON(github.event.commits.*.message), '[skip ci]') && + ! contains(toJSON(github.event.commits.*.message), '[skip github]') + + strategy: + matrix: + version: [12, 11, 10, 9, 8, 7] + + runs-on: ubuntu-latest + + name: Clang ${{ matrix.version }} + + container: + image: teeks99/clang-ubuntu:${{ matrix.version }} + + options: -v /usr/local:/host_usr_local + + env: + CC: clang-${{ matrix.version }} + CXX: clang++-${{ matrix.version }} + CXXFLAGS: -stdlib=libc++ + + steps: + - uses: actions/checkout@v1 + + - uses: friendlyanon/fetch-core-count@v1 + id: cores + + - name: CMake + run: echo "/host_usr_local/bin" >> $GITHUB_PATH + + - name: Install dependencies + run: | + apt-get update + apt-get install -y git + script/ci_install_deps.sh + + - name: Configure + run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug + + - name: Build + run: cmake --build build -j ${{ steps.cores.outputs.count }} + + - name: Run + working-directory: build + run: ctest --output-on-failure -j ${{ steps.cores.outputs.count }} + + gcc_tests: + if: >- + ! contains(toJSON(github.event.commits.*.message), '[skip ci]') && + ! contains(toJSON(github.event.commits.*.message), '[skip github]') + + strategy: + matrix: + version: [10, 9, 8] + + runs-on: ubuntu-latest + + name: GCC ${{ matrix.version }} + + container: + image: gcc:${{ matrix.version }} + + options: -v /usr/local:/host_usr_local + + steps: + - uses: actions/checkout@v1 + + - uses: friendlyanon/fetch-core-count@v1 + id: cores + + - name: CMake + run: echo "/host_usr_local/bin" >> $GITHUB_PATH + + - name: Install dependencies + run: script/ci_install_deps.sh + + - name: Configure + run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug + + - name: Build + run: cmake --build build -j ${{ steps.cores.outputs.count }} + + - name: Run + working-directory: build + run: ctest --output-on-failure -j ${{ steps.cores.outputs.count }}