mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-17 11:05:45 +01:00
merge all seperate jobs into a single job, since this is more efficient.
This commit is contained in:
74
.github/workflows/ci.yaml
vendored
74
.github/workflows/ci.yaml
vendored
@@ -11,12 +11,20 @@ env:
|
|||||||
VCPKG_ROOT: ${{github.workspace}}/.vcpkg
|
VCPKG_ROOT: ${{github.workspace}}/.vcpkg
|
||||||
DEPS_VCPKG: glfw3:x64-linux-dynamic glfw3:x64-mingw-static
|
DEPS_VCPKG: glfw3:x64-linux-dynamic glfw3:x64-mingw-static
|
||||||
jobs:
|
jobs:
|
||||||
setup-vcpkg:
|
#
|
||||||
|
# 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
|
runs-on: ubuntu-latest
|
||||||
container: ghcr.io/thepigeongenerator/mcaselector-lite:latest
|
container: ghcr.io/thepigeongenerator/mcaselector-lite:latest
|
||||||
outputs:
|
|
||||||
CACHE_KEY_VCPKG: ${{steps.gen-keys.outputs.HASH_VCPKG}}
|
|
||||||
steps:
|
steps:
|
||||||
|
#
|
||||||
|
# general setup
|
||||||
|
#
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
#
|
||||||
|
# VCPKG setup
|
||||||
|
#
|
||||||
- id: gen-keys
|
- id: gen-keys
|
||||||
run: echo "HASH_VCPKG=vcpkg-$(echo "$DEPS_VCPKG" | sha256sum | cut -d ' ' -f1)" >>"$GITHUB_OUTPUT"
|
run: echo "HASH_VCPKG=vcpkg-$(echo "$DEPS_VCPKG" | sha256sum | cut -d ' ' -f1)" >>"$GITHUB_OUTPUT"
|
||||||
# load the vcpkg cache
|
# load the vcpkg cache
|
||||||
@@ -32,53 +40,13 @@ jobs:
|
|||||||
git clone https://github.com/microsoft/vcpkg.git "$VCPKG_ROOT"
|
git clone https://github.com/microsoft/vcpkg.git "$VCPKG_ROOT"
|
||||||
"$VCPKG_ROOT/bootstrap-vcpkg.sh"
|
"$VCPKG_ROOT/bootstrap-vcpkg.sh"
|
||||||
"$VCPKG_ROOT/vcpkg" install $DEPS_VCPKG
|
"$VCPKG_ROOT/vcpkg" install $DEPS_VCPKG
|
||||||
compile:
|
#
|
||||||
needs: setup-vcpkg
|
# compilation
|
||||||
runs-on: ubuntu-latest
|
#
|
||||||
container: ghcr.io/thepigeongenerator/mcaselector-lite:latest
|
- run: make compile MARCH=x86_64 KERNEL=linux CC=x86_64-linux-gnu-gcc -j
|
||||||
strategy:
|
- run: make compile MARCH=x86_64 KERNEL=mingw CC=x86_64-w64-mingw32-gcc -j
|
||||||
matrix:
|
#
|
||||||
include:
|
# executing unit tests
|
||||||
- kernel: linux
|
#
|
||||||
march: x86_64
|
- run: make run MARCH=x86_64 KERNEL=linux CC=x86_64-linux-gnu-gcc DEBUG=test -j
|
||||||
cc: x86_64-linux-gnu-gcc
|
# WARN: not testing windows, probably should do that
|
||||||
- kernel: mingw
|
|
||||||
march: x86_64
|
|
||||||
cc: x86_64-w64-mingw32-gcc
|
|
||||||
steps:
|
|
||||||
# load the vcpkg cache
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
id: cache-vcpkg
|
|
||||||
with:
|
|
||||||
path: ${{env.VCPKG_ROOT}}
|
|
||||||
key: ${{needs.setup-vcpkg.outputs.CACHE_KEY_VCPKG}}
|
|
||||||
- if: steps.cache-vcpkg.outputs.cache-hit != 'true'
|
|
||||||
run: echo -e "\033[31mcache failed to load!\033[0m" >&2; exit 1
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
# compile
|
|
||||||
- name: compile ${{matrix.march}}-${{matrix.kernel}}
|
|
||||||
run: make compile MARCH=${{matrix.march}} KERNEL=${{matrix.kernel}} CC=${{matrix.cc}} -j
|
|
||||||
test:
|
|
||||||
needs: setup-vcpkg
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: ghcr.io/thepigeongenerator/mcaselector-lite:latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- kernel: linux
|
|
||||||
march: x86_64
|
|
||||||
cc: x86_64-linux-gnu-gcc
|
|
||||||
# WARN: not testing win-x86_64... Probably a good idea to do that
|
|
||||||
steps:
|
|
||||||
# load the vcpkg cache
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
id: cache-vcpkg
|
|
||||||
with:
|
|
||||||
path: ${{env.VCPKG_ROOT}}
|
|
||||||
key: ${{needs.setup-vcpkg.outputs.CACHE_KEY_VCPKG}}
|
|
||||||
- if: steps.cache-vcpkg.outputs.cache-hit != 'true'
|
|
||||||
run: echo -e "\033[31mcache failed to load!\033[0m" >&2; exit 1
|
|
||||||
# compile and execute tests
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: execute tests for ${{matrix.march}}-${{matrix.kernel}}
|
|
||||||
run: make KERNEL=${{matrix.kernel}} CC=${{matrix.cc}} DEBUG=test run MARCH=${{matrix.march}} -j
|
|
||||||
|
|||||||
Reference in New Issue
Block a user