Files
jak-project/.github/workflows/windows-build-msvc.yaml
T
Tyler Wilding 5b9106302d ci: move to sccache (#3404)
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!)
2024-03-06 22:21:36 -05:00

66 lines
2.0 KiB
YAML

name: Windows Build MSVC
on:
workflow_call:
inputs:
cmakePreset:
required: true
type: string
cachePrefix:
required: true
type: string
jobs:
build:
name: MSVC
runs-on: windows-2022
timeout-minutes: 60
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install NASM
# TODO - Simplify this with just the first command once choco 2.0 rolls out everywhere
run: |
$chocoVersion = choco --version
if ($chocoVersion.StartsWith("2.")) {
choco install nasm --source="${{ github.workspace }}/third-party/nasm"
} else {
choco install ${{ github.workspace }}/third-party/nasm/old/nasm.2.15.05.nupkg
}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@v1.2.12
with:
variant: sccache
key: windows-2022-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }}
restore-keys: windows-2022-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}
max-size: 1000M
- uses: ilammy/msvc-dev-cmd@v1
# Fixes an issue with the image causing builds to fail - https://github.com/actions/runner-images/issues/8598
- name: Remove Strawberry Perl from PATH
run: |
$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", ""
"PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: CMake Generation - MSVC
shell: cmd
run: cmake -B build --preset=${{ inputs.cmakePreset }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache .
- name: Build Project
shell: cmd
run: |
set CL=/MP
cmake --build build --parallel %NUMBER_OF_PROCESSORS%
- name: Run Tests
timeout-minutes: 10
env:
GTEST_OUTPUT: "xml:opengoal-test-report.xml"
run: |
./build/bin/goalc-test.exe --gtest_color=yes --gtest_brief=0 --gtest_filter="-*MANUAL_TEST*"