Files
balatro-gba-chinese-jocker-…/.github/workflows/build_ci_workflow.yml
T
Rickey d32d567c2b Add nightly rom releases (#182)
* Add nightly rom releases

* Begin testing CI

* Add tests workflow

* Move release tag workflow

* Fix upload logic for intermediate artifact

* Fix variable add names

* Update build CI

* Update nightly upload location

* Add git hash to output

* Update upload location again

* Update name to have a date

* Adjust date format for consistency
2025-10-31 22:00:15 -07:00

76 lines
2.0 KiB
YAML

name: Build CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
clear-cache:
description: 'Clear docker cache before running'
type: boolean
default: false
workflow_call:
inputs:
upload-build-artifact:
required: true
type: boolean
default: true
jobs:
run-tests-job:
name: Run tests
uses: ./.github/workflows/run_tests_ci_workflow.yml
build:
name: Build ROM
runs-on: ubuntu-latest
needs: run-tests-job
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Get docker image cache
uses: actions/cache@v4
with:
path: /tmp/docker-cache
key: docker-images-${{ hashFiles('docker-compose.yml') }}
- name: Clear docker cache (if requested)
if: github.event.inputs.clear-cache == 'true'
run: |
echo "Clearing Docker cache..."
rm -rf /tmp/docker-cache
echo "Docker cache cleared"
- name: Load or pull images
run: |
if [ -f /tmp/docker-cache/balatro.tar ]; then
echo "Loading Image"
docker load -i /tmp/docker-cache/balatro.tar
else
echo "Pulling Image"
docker compose pull balatro
mkdir -p /tmp/docker-cache
docker save $(docker compose config | grep image: | awk '{print $2}') -o /tmp/docker-cache/balatro.tar
fi
- name: Export UID/GID for Compose
run: |
echo "UID=$(id -u)" >> "$GITHUB_ENV"
echo "GID=$(id -g)" >> "$GITHUB_ENV"
- name: Build the project
run: docker compose -f docker-compose.yml run --rm balatro sh -c "make -j$(nproc) && ./scripts/get_memory_map.sh"
- name: 'Upload Artifact'
if: ${{ inputs.upload-build-artifact }}
uses: actions/upload-artifact@v4
with:
name: build-out
path: build
retention-days: 5