Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Fixes for ME2 launch failures in some scenarios #188

Fixes for ME2 launch failures in some scenarios

Fixes for ME2 launch failures in some scenarios #188

Workflow file for this run

# Copyright (c) 2021 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
# A GitHub workflow using CMake, Ninja and vcpkg.
# It is called "pure" because it is an example which minimizes the usage of custom GitHub actions, but leverages directly the tools that could be easily run on your development machines (i.e. CMake, vcpkg, Ninja).
name: hosted-pure-workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
job:
name: ${{ matrix.os }}-hosted-pure
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
triplet: x64-windows
env:
# Indicates the CMake build directory where project files and binaries are being produced.
CMAKE_BUILD_DIR: ${{ github.workspace }}/builddir/
# Indicates the location of the vcpkg as a Git submodule of the project repository.
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@v2
with:
submodules: true
path: src_repo
- uses: actions/checkout@v2
with:
repository: 'microsoft/vcpkg'
path: vcpkg
submodules: true
ref: "2023.02.24"
# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest
# Restore both vcpkg and its artifacts from the GitHub cache service.
- name: Restore vcpkg and its artifacts.
uses: actions/cache@v2
with:
# The first path is where vcpkg generates artifacts while consuming the vcpkg.json manifest file.
# The second path is the location of vcpkg (it contains the vcpkg executable and data files).
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
path: |
${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
# The key is composed in a way that it gets properly invalidated: this must happen whenever vcpkg's Git commit id changes, or the list of packages changes. In this case a cache miss must happen and a new entry with a new key with be pushed to GitHub the cache service.
# The key includes: hash of the vcpkg.json file, the hash of the vcpkg Git commit id, and the used vcpkg's triplet. The vcpkg's commit id would suffice, but computing an hash out it does not harm.
# Note: given a key, the cache content is immutable. If a cache entry has been created improperly, in order the recreate the right content the key must be changed as well, and it must be brand new (i.e. not existing already).
key: |
${{ hashFiles( 'vcpkg.json' ) }}-${{ matrix.triplet }}-invalidate
- name: Show content of workspace after cache has been restored
run: find $RUNNER_WORKSPACE
shell: bash
# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1
# Run CMake to generate Ninja project files, using the vcpkg's toolchain file to resolve and install the dependencies as specified in vcpkg.json.
- name: Download ScyllaHide
run: ./tools/setup-scylla.ps1
shell: pwsh
working-directory: "${{ github.workspace }}/src_repo"
- name: Install dependencies and generate project files
run: |
cmake -S "${{ github.workspace }}/src_repo" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja \
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
-DMODENGINE_DIST_SCYLLA=1 \
-DMODENGINE_CRASH_REPORT_URL=${{ secrets.MODENGINE_CRASH_REPORT_URL }} \
-DCPACK_GENERATOR=ZIP \
-DVCPKG_OVERLAY_PORTS=src_repo/third-party/vcpkg-overlays \
-DCMAKE_BUILD_TYPE=MinSizeRel
shell: bash
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target package
- name: Show content of workspace at its completion
run: find $RUNNER_WORKSPACE
shell: bash
- name: 'Upload artifacts'
uses: actions/upload-artifact@v2
with:
name: 'modengine-${{ github.sha }}'
path: '${{ env.CMAKE_BUILD_DIR }}/ModEngine-*-win64.*' # FIXME gtierney: run-cmake isn't respecting CMAKE_INSTALL_PREFIX
if: ${{ github.event_name == 'push' }}