mirror of
https://github.com/open-goal/jak-project
synced 2026-06-07 20:11:39 -04:00
5b9106302d
The original buildcache action has been archived, and buildcache itself has also moved to github. I forked the action and was updating it to work, but then the latest buildcache release once again breaks support for older runners (in our case, macos-12 is the lowest, which is acceptable as 11 is EOL). Either way, switching to sccache is not only a way cleaner solution but it is also well maintained (and works!)
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: Linux Build Clang
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
cmakePreset:
|
|
required: true
|
|
type: string
|
|
cachePrefix:
|
|
required: true
|
|
type: string
|
|
uploadArtifacts:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
build:
|
|
name: Clang
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Package Dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install build-essential cmake \
|
|
clang gcc g++ lcov make nasm libxrandr-dev \
|
|
libxinerama-dev libxcursor-dev libpulse-dev \
|
|
libxi-dev zip ninja-build libgl1-mesa-dev libssl-dev
|
|
|
|
- name: Setup sccache
|
|
uses: hendrikmuhs/ccache-action@v1.2.12
|
|
with:
|
|
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
|
|
|
|
- name: CMake Generation
|
|
env:
|
|
CC: clang
|
|
CXX: clang++
|
|
run: |
|
|
cmake -B build --preset=${{ inputs.cmakePreset }} \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
|
|
|
|
- name: Build Project
|
|
run: cmake --build build --parallel $((`nproc`))
|
|
|
|
- name: Run Tests
|
|
env:
|
|
GTEST_OUTPUT: "xml:opengoal-test-report.xml"
|
|
run: ./test.sh
|
|
|
|
- name: Prepare artifacts
|
|
if: ${{ inputs.uploadArtifacts }}
|
|
run: |
|
|
strip ./build/goalc/goalc
|
|
strip ./build/decompiler/extractor
|
|
strip ./build/game/gk
|
|
strip ./build/lsp/lsp
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
if: ${{ inputs.uploadArtifacts }}
|
|
with:
|
|
name: opengoal-linux-${{ inputs.cachePrefix }}
|
|
if-no-files-found: error
|
|
path: |
|
|
./build/goalc/goalc
|
|
./build/decompiler/extractor
|
|
./build/game/gk
|
|
./build/lsp/lsp
|