Files
jak-project/.github/workflows/windows-workflow.yaml
T
Tyler Wilding fb532f2a53 release: include error metadata file for launcher purposes (#1463)
* release: include error metadata file for launcher purposes

* release: put release assets in the top level of the 7z/tarball (no out/ dir)

* extractor: ensure critical directories are created

* extractor: handle weird Win32 path prefix `\\?\` by stripping it out

* release: avoid using `-C` with `tar`
2022-06-17 22:05:02 -04:00

101 lines
3.9 KiB
YAML

name: Windows
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build:
strategy:
# Prevent one build from failing everything (although maybe those should be included as experimental builds instead)
fail-fast: false
matrix:
os: [windows-2022]
compiler: [msvc, clang]
experimental: [false]
name: ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 45
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
uses: actions/checkout@v2
- name: Checkout Submodules
run: git submodule update --init --recursive -j 2
- name: Install Dependencies
run: Choco-Install -PackageName nasm
- name: Setup Buildcache
uses: mikehardy/buildcache-action@v1.2.2
with:
cache_key: ${{ matrix.os }}-${{ matrix.compiler }}
# TODO - eventually fight with this to get it to use Ninja and such
- name: CMake Generation
shell: cmd # ideally id like everything to be powershell but running this bat file is finicky
run: |
if "${{ matrix.compiler }}" == "clang" (
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_FOR_RELEASE=ON -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" .
) else (
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache.exe .
)
- name: Build Project
working-directory: ./build
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
if "${{ matrix.compiler }}" == "msvc" (
set CL=/MP
)
nmake
- name: Run Tests
timeout-minutes: 5
env:
NEXT_DIR: ${{ github.workspace }}
run: ./build/bin/goalc-test.exe --gtest_color=yes --gtest_filter="-*MANUAL_TEST*"
# ---- Release / Tagging related steps ----
- name: Prepare Build Artifacts
if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang'
shell: bash
run: |
mkdir -p ./ci-artifacts/out
./.github/scripts/releases/extract_build_windows.sh ./ci-artifacts/out ./
7z a -tzip ./ci-artifacts/windows.zip ./ci-artifacts/out/*
- name: Upload Assets and Potential Publish Release
if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang'
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts
ASSET_EXTENSION: zip
TAG_TO_SEARCH_FOR: ${{ github.REF }}
run: |
cd ./.github/scripts/releases/upload-release-artifacts
npm ci
node index.js