CI - Build #575
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
on: | ||
pull_request: | ||
# push: | ||
# branches: | ||
# - master | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: 'Ref to build (for Pull Requests, use refs/pull/NNN/head)' | ||
required: true | ||
env: | ||
CTEST_OUTPUT_ON_FAILURE: 1 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | ||
jobs: | ||
windows: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, windows-2019] | ||
arch: [x86, x64] | ||
name: Windows (${{ matrix.os }} / ${{ matrix.arch }}) | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
if: github.event_name != 'workflow_dispatch' | ||
uses: actions/checkout@v3 | ||
- name: Checkout (Manual) | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
- name: Setup vcpkg caching | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite') | ||
- name: Install OpenGFX | ||
shell: bash | ||
run: | | ||
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset" | ||
cd "C:/Users/Public/Documents/OpenTTD/baseset" | ||
echo "::group::Download OpenGFX" | ||
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip | ||
echo "::endgroup::" | ||
echo "::group::Unpack OpenGFX" | ||
unzip opengfx-all.zip | ||
echo "::endgroup::" | ||
rm -f opengfx-all.zip | ||
- name: Install MSVC problem matcher | ||
uses: ammaraskar/msvc-problem-matcher@master | ||
- name: Configure developer command prompt for ${{ matrix.arch }} | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
- name: Build | ||
shell: bash | ||
run: | | ||
mkdir build | ||
cd build | ||
echo "::group::CMake" | ||
cmake .. \ | ||
-GNinja \ | ||
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \ | ||
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \ | ||
# EOF | ||
echo "::endgroup::" | ||
echo "::group::Build" | ||
cmake --build . -t all openttd_test | ||
echo "::endgroup::" | ||
- name: Test | ||
shell: bash | ||
run: | | ||
cd build | ||
ctest --timeout 120 | ||
check_annotations: | ||
name: Check Annotations | ||
needs: | ||
- emscripten | ||
Check failure on line 103 in .github/workflows/ci-build.yml GitHub Actions / CIInvalid workflow file
|
||
- linux | ||
- macos | ||
- windows | ||
- msys2 | ||
if: always() && github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check annotations | ||
uses: OpenTTD/actions/annotation-check@v3 |