Files
jak-project/.github/workflows/linux-workflow.yaml
T
2021-09-06 14:29:34 -04:00

87 lines
2.9 KiB
YAML

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: 20
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: Coveralls
if: ${{ matrix.compiler }} != 'clang'
uses: coverallsapp/github-action@master
continue-on-error: true # Sometimes Coveralls has intermittent problems, and codecoverage isn't critical to our success
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./build/goalc-test_coverage.info