Files
mcaselector-lite/.github/workflows/ci.yaml

53 lines
1.6 KiB
YAML

# Copyright (c) 2025 Quinn
# Licensed under the MIT Licence. See LICENSE for details
name: CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
env:
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
steps:
# general setup
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: get workflow data
id: libdat
run: |
echo "LIBS_PATH=$(git submodule foreach -q 'echo $sm_path' | sed '$!N; s/\n/ /')" >>"$GITHUB_OUTPUT"
echo "LIBS_HASH=libs-$(git submodule foreach -q 'echo $sha1' | sha256sum | cut -d ' ' -f1)" >>"$GITHUB_OUTPUT"
# restore the cache
- uses: actions/cache@v4
id: lib-cache
with:
path: ${{steps.libdat.outputs.LIBS_PATH}} lib/glad/gl.o
key: ${{steps.libdat.outputs.LIBS_HASH}}
restore-keys: libs-
- name: compile libraries on cache miss
if: steps.lib-cache.outputs.cache-hit != 'true'
run: |
while read mod; do {
cd "$mod"
git pull -f
cd -
}; done <<<"${{steps.libdat.outputs.LIBS_PATH}}"
make libs
# perform continuous integrations actions
- run: make x86_64-linux-gnu-gcc CALL=compile -j
- run: make x86_64-w64-mingw32-gcc CALL=compile -j
- run: make x86_64-linux-gnu-gcc CALL=run DEBUG=test -j
- run: make x86_64-w64-mingw32-gcc CALL=run DEBUG=test -j