2022-07-16 19:25:10 -04:00
|
|
|
name: Linux Build GCC
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
cmakePreset:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
cachePrefix:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: GCC
|
|
|
|
runs-on: ubuntu-20.04
|
2023-06-04 14:08:35 -04:00
|
|
|
timeout-minutes: 60
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
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
|
2023-09-30 23:36:22 -04:00
|
|
|
uses: actions/checkout@v4
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
- name: Install Package Dependencies
|
2023-09-14 01:31:08 -04:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install build-essential cmake \
|
2024-02-18 13:23:19 -05:00
|
|
|
clang gcc-10 g++-10 lcov make nasm libxrandr-dev \
|
2023-09-14 01:31:08 -04:00
|
|
|
libxinerama-dev libxcursor-dev libpulse-dev \
|
2023-10-11 20:43:55 -04:00
|
|
|
libxi-dev zip ninja-build libgl1-mesa-dev libssl-dev
|
2022-07-16 19:25:10 -04:00
|
|
|
|
2024-02-18 13:23:19 -05:00
|
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
|
|
|
|
sudo update-alternatives --set gcc /usr/bin/gcc-10
|
|
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
|
|
|
|
sudo update-alternatives --set g++ /usr/bin/g++-10
|
|
|
|
|
2022-07-16 19:25:10 -04:00
|
|
|
- name: Setup Buildcache
|
2022-11-02 00:22:10 -04:00
|
|
|
uses: mikehardy/buildcache-action@v2.1.0
|
2022-07-16 19:25:10 -04:00
|
|
|
with:
|
|
|
|
cache_key: linux-ubuntu-20.04-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}
|
2022-10-29 18:22:02 -04:00
|
|
|
buildcache_tag: v0.28.1
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
- name: CMake Generation
|
|
|
|
env:
|
|
|
|
CC: gcc
|
|
|
|
CXX: g++
|
|
|
|
run: |
|
|
|
|
cmake -B build --preset=${{ inputs.cmakePreset }} \
|
2023-04-30 14:27:08 -04:00
|
|
|
-DCODE_COVERAGE=OFF \
|
2022-07-16 19:25:10 -04:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache
|
|
|
|
|
|
|
|
- name: Build Project
|
2022-12-22 18:12:59 -05:00
|
|
|
run: cmake --build build --parallel $((`nproc`)) -- -w dupbuild=warn
|
2022-07-16 19:25:10 -04:00
|
|
|
|
2023-04-30 14:27:08 -04:00
|
|
|
- name: Run Tests
|
|
|
|
run: ./test.sh
|
2022-07-16 19:25:10 -04:00
|
|
|
|
2023-04-30 14:27:08 -04:00
|
|
|
# - name: Submit Coverage Report to Codacy
|
|
|
|
# uses: codacy/codacy-coverage-reporter-action@v1
|
|
|
|
# continue-on-error: true
|
|
|
|
# with:
|
|
|
|
# project-token: ${{ secrets.CODACY_PROJECT_KEY }}
|
|
|
|
# coverage-reports: ./build/goalc-test_coverage.info
|