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
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-03-06 22:21:36 -05:00
|
|
|
- name: Setup sccache
|
2024-09-01 09:26:37 -04:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2.14
|
2022-07-16 19:25:10 -04:00
|
|
|
with:
|
2024-03-06 22:21:36 -05:00
|
|
|
variant: sccache
|
|
|
|
key: linux-ubuntu-20.04-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }}
|
|
|
|
restore-keys: linux-ubuntu-20.04-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}
|
|
|
|
max-size: 1000M
|
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 \
|
2024-03-06 22:21:36 -05:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
- 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
|