Update Github Actions CI to use Docker Compose
This commit is contained in:
@@ -2,11 +2,12 @@ name: Build CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -15,47 +16,15 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set devkitPro environment variables
|
|
||||||
run: |
|
|
||||||
# Installing to home directory to avoid permission denied on caching
|
|
||||||
echo "DEVKITPRO=/home/runner/devkitpro" >> $GITHUB_ENV
|
|
||||||
echo "DEVKITARM=/home/runner/devkitpro/devkitARM" >> $GITHUB_ENV
|
|
||||||
export PATH=$DEVKITARM/bin:$DEVKITPRO/tools/bin:$PATH
|
|
||||||
|
|
||||||
# Caching to avoid excessive request to the devkitpro server from a runner because they
|
|
||||||
# eventually block and result in permission denied 403.
|
|
||||||
# If that happens it takes like 2 hours until you can make requests again
|
|
||||||
- name: Cache devkitPro toolchain
|
|
||||||
id: cache-devkitpro
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /home/runner/devkitpro
|
|
||||||
# Using a manual key version suffix - v{num}, if changes are made that make the
|
|
||||||
# cache stale and require a refresh, just bump the version number so there's
|
|
||||||
# a cache miss. The key needs to match in the "Save devkitPro to cache" stage
|
|
||||||
# so you need to bump the number there too...
|
|
||||||
key: devkitpro-${{ runner.os }}-v1
|
|
||||||
|
|
||||||
- name: Set up devkitARM (if not cached)
|
- name: Export UID/GID for Compose
|
||||||
if: steps.cache-devkitpro.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
echo "UID=$(id -u)" >> "$GITHUB_ENV"
|
||||||
wget https://apt.devkitpro.org/install-devkitpro-pacman
|
echo "GID=$(id -g)" >> "$GITHUB_ENV"
|
||||||
chmod +x install-devkitpro-pacman
|
|
||||||
sudo ./install-devkitpro-pacman
|
|
||||||
mkdir -p "$DEVKITPRO"
|
|
||||||
sudo dkp-pacman -Sy --noconfirm gba-dev
|
|
||||||
# Copy from installed directory to cacheable directory
|
|
||||||
sudo cp -r /opt/devkitpro "/home/runner"
|
|
||||||
sudo chown -R $USER:$USER "/home/runner/devkitpro"
|
|
||||||
- name: Save devkitPro to cache
|
|
||||||
if: steps.cache-devkitpro.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/cache/save@v4
|
|
||||||
with:
|
|
||||||
path: /home/runner/devkitpro
|
|
||||||
key: devkitpro-${{ runner.os }}-v1
|
|
||||||
|
|
||||||
- name: Build the project
|
- name: Build the project
|
||||||
run: |
|
run: docker compose -f docker-compose.yml run --rm balatro sh -c "make -j$(nproc)"
|
||||||
make
|
|
||||||
|
- name: Compose down
|
||||||
|
if: always()
|
||||||
|
run: docker compose -f docker-compose.yml down -v || true
|
||||||
|
|||||||
Reference in New Issue
Block a user