2022-07-16 19:25:10 -04:00
|
|
|
name: Windows Build Clang
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
cmakePreset:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
cachePrefix:
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-07-30 18:50:24 -04:00
|
|
|
uploadArtifacts:
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Clang
|
|
|
|
runs-on: windows-2022
|
|
|
|
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
|
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 NASM
|
2023-06-09 00:01:50 -04:00
|
|
|
# TODO - Simplify this with just the first command once choco 2.0 rolls out everywhere
|
|
|
|
run: |
|
|
|
|
$chocoVersion = choco --version
|
2023-06-09 13:55:50 -04:00
|
|
|
if ($chocoVersion.StartsWith("2.")) {
|
2023-06-09 00:01:50 -04:00
|
|
|
choco install nasm --source="${{ github.workspace }}/third-party/nasm"
|
|
|
|
} else {
|
|
|
|
choco install ${{ github.workspace }}/third-party/nasm/old/nasm.2.15.05.nupkg
|
|
|
|
}
|
2022-07-16 19:25:10 -04:00
|
|
|
|
2024-03-06 22:21:36 -05:00
|
|
|
- name: Setup sccache
|
2024-05-01 15:53:40 -04:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
2022-07-16 19:25:10 -04:00
|
|
|
with:
|
2024-03-06 22:21:36 -05:00
|
|
|
variant: sccache
|
|
|
|
key: windows-2022-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }}
|
|
|
|
restore-keys: windows-2022-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}
|
|
|
|
max-size: 1000M
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
|
2023-11-02 02:29:19 -04:00
|
|
|
# https://github.com/actions/runner-images/issues/5459
|
|
|
|
# Causes binaries to be built differently, get rid of this garbage
|
|
|
|
- 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
|
|
|
|
|
2022-07-16 19:25:10 -04:00
|
|
|
- name: CMake Generation
|
|
|
|
shell: cmd
|
2024-03-06 22:21:36 -05:00
|
|
|
run: cmake -B build --preset=${{ inputs.cmakePreset }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache .
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
- name: Build Project
|
|
|
|
shell: cmd
|
2022-12-22 18:12:59 -05:00
|
|
|
run: cmake --build build --parallel %NUMBER_OF_PROCESSORS%
|
2022-07-16 19:25:10 -04:00
|
|
|
|
|
|
|
- name: Run Tests
|
2022-08-05 12:12:33 -04:00
|
|
|
env:
|
|
|
|
GTEST_OUTPUT: "xml:opengoal-test-report.xml"
|
2022-09-24 16:04:52 -04:00
|
|
|
run: ./build/bin/goalc-test.exe --gtest_color=yes --gtest_brief=0 --gtest_filter="-*MANUAL_TEST*"
|
2022-08-05 12:12:33 -04:00
|
|
|
|
2022-08-17 00:57:59 -04:00
|
|
|
- name: Upload artifact
|
2024-01-04 01:32:40 -05:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-07-30 18:50:24 -04:00
|
|
|
if: ${{ inputs.uploadArtifacts }}
|
2022-08-17 00:57:59 -04:00
|
|
|
with:
|
|
|
|
name: opengoal-windows-${{ inputs.cachePrefix }}
|
|
|
|
if-no-files-found: error
|
|
|
|
path: ./build/bin
|
|
|
|
|