name: Linux # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: push: branches: - master pull_request: branches: - master jobs: build: strategy: # Prevent one build from failing everything (although maybe those should be included as experimental builds instead) fail-fast: false matrix: os: [ubuntu-20.04] config: [Debug] # TODO - Eventually we need to make a Release Config compiler: [clang, gcc] experimental: [false] name: ${{ matrix.config }}-${{ matrix.compiler }} runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} # Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them. timeout-minutes: 45 env: # overrides: https://github.com/mbitsnbites/buildcache/blob/master/doc/configuration.md BUILDCACHE_MAX_CACHE_SIZE: 1000000000 # 1gb BUILDCACHE_COMPRESS_FORMAT: ZSTD BUILDCACHE_COMPRESS_LEVEL: 19 BUILDCACHE_DIRECT_MODE: true BUILDCACHE_LOG_FILE: ${{ github.workspace }}/buildcache.log steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Checkout Submodules run: git submodule update --init --recursive -j 2 - name: Get Package Dependencies run: sudo apt install build-essential cmake clang gcc g++ lcov make nasm libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev - name: Setup Buildcache uses: mikehardy/buildcache-action@v1.2.2 with: cache_key: ${{ matrix.os }}-${{ matrix.config }}-${{ matrix.compiler }} - name: CMake Generation run: | if [ "${{ matrix.compiler }}" == 'clang' ]; then export CC=clang export CXX=clang++ cmake -B build -DCODE_COVERAGE=ON -DASAN_BUILD=ON else export CC=gcc export CXX=g++ cmake -B build \ -DCMAKE_C_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache \ -DCMAKE_CXX_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache \ -DCODE_COVERAGE=ON fi - name: Build Project working-directory: ./build run: | make -j4 - name: Run Tests run: | if [ "${{ matrix.compiler }}" == 'clang' ]; then ./test.sh else ./test_code_coverage.sh fi - name: Submit Coverage Report to Codacy if: ${{ matrix.compiler }} != 'clang' uses: codacy/codacy-coverage-reporter-action@v1 continue-on-error: true with: project-token: ${{ secrets.CODACY_PROJECT_KEY }} # lcov report coverage-reports: ./build/goalc-test_coverage.info