Files
calorie-counter/.gitea/workflows/ci.yml
Andris Enins 3d4c4bbdf0
Some checks are pending
CI / Build & test backend (push) Waiting to run
fix: install Maven 3.9.9 in CI — mvn was not in PATH on pi-runner
actions/setup-java@v4 installs the JDK but not Maven itself.
pi-runner does not have mvn pre-installed. Add an explicit curl
install step matching the approach used in backend/Dockerfile.
2026-05-19 12:46:08 +00:00

52 lines
1.4 KiB
YAML

# Generated by GitHub Copilot
#
# ci.yml — Build and test the calorie-counter backend
#
# Runs on every push to main and every PR targeting main.
# Produces a green/red signal that docker.yml waits for before building images.
#
# Runs on pi-runner (native ARM64) — no QEMU, no cross-compilation overhead.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel any in-progress CI run for the same ref so the single-capacity Pi
# runner is not blocked by a superseded run.
concurrency:
group: ci-${{ gitea.ref }}
cancel-in-progress: true
jobs:
test:
name: Build & test backend
runs-on: pi-runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java 21 LTS
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
# actions/setup-java installs the JDK but not Maven.
# pi-runner has no pre-installed mvn — download the same version used
# in backend/Dockerfile to keep the build environment consistent.
- name: Install Maven 3.9.9
run: |
curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \
| tar -xz -C /opt
echo "/opt/apache-maven-3.9.9/bin" >> $GITHUB_PATH
- name: Run tests
working-directory: backend
run: mvn -q -ntp clean verify