mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-16 19:45:46 +01:00
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
# Copyright (c) 2025 Quinn
|
|
# Licensed under the MIT Licence. See LICENSE for details
|
|
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
env:
|
|
VCPKG_DISABLE_METRICS: 1
|
|
VCPKG_ROOT: ${{github.workspace}}/.vcpkg
|
|
DEPS_VCPKG: glfw3:x64-linux-dynamic glfw3:x64-mingw-static
|
|
WINEPREFIX: /tmp/wineprefix
|
|
jobs:
|
|
#
|
|
# the mega job containing all things we need to do, since setting up a single system is more efficient than installing the same stuff on multiple ones
|
|
#
|
|
exec-ci-tasks:
|
|
runs-on: ubuntu-latest
|
|
container: ghcr.io/thepigeongenerator/mcaselector-lite:latest
|
|
steps:
|
|
#
|
|
# general setup
|
|
#
|
|
- uses: actions/checkout@v4
|
|
#
|
|
# VCPKG setup
|
|
#
|
|
- id: gen-keys
|
|
run: echo "HASH_VCPKG=vcpkg-$(echo "$DEPS_VCPKG" | sha256sum | cut -d ' ' -f1)" >>"$GITHUB_OUTPUT"
|
|
# load the vcpkg cache
|
|
- uses: actions/cache@v4
|
|
id: vcpkg-cache
|
|
with:
|
|
path: ${{env.VCPKG_ROOT}}
|
|
key: ${{steps.gen-keys.outputs.HASH_VCPKG}}
|
|
restore-keys: vcpkg-
|
|
# setup vcpkg if the cache didn't hit
|
|
- if: steps.vcpkg-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
git clone https://github.com/microsoft/vcpkg.git "$VCPKG_ROOT"
|
|
"$VCPKG_ROOT/bootstrap-vcpkg.sh"
|
|
"$VCPKG_ROOT/vcpkg" install $DEPS_VCPKG
|
|
# compilation (using bulk compilation)
|
|
- run: make all CALL=compile -j || echo "JOB_FAILED=1" >>"$GITHUB_ENV"
|
|
# executing unit tests (using bulk flags)
|
|
- run: make all CALL=run DEBUG=test -j || echo "JOB_FAILED=1" >>"$GITHUB_ENV"
|
|
# exit if any errors occurred
|
|
- name: exit on errors
|
|
run: |
|
|
[ "$JOB_FAILED" != "1" ]
|