Some checks failed
CI / Test and build (push) Has been cancelled
Host-mode workflows run Go inside golang:1.25-bookworm. CI covers push/PR; tagged v* builds multi-arch artifacts and publishes a Forgejo release.
40 lines
1 KiB
YAML
40 lines
1 KiB
YAML
# Host-mode runner: no local Go — use official golang image + docker.sock.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: magpie-ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Test and build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
|
|
|
- name: Go test and build
|
|
run: |
|
|
set -euo pipefail
|
|
case "$GITHUB_WORKSPACE" in
|
|
/data/*) HOST_WORKSPACE="/opt/forgejo-runner/data${GITHUB_WORKSPACE#/data}" ;;
|
|
*) HOST_WORKSPACE="$GITHUB_WORKSPACE" ;;
|
|
esac
|
|
test -f "$GITHUB_WORKSPACE/go.mod"
|
|
docker run --rm --network host \
|
|
--volume "$HOST_WORKSPACE:/src" \
|
|
--workdir /src \
|
|
-e CGO_ENABLED=0 \
|
|
golang:1.25-bookworm \
|
|
bash -lc '
|
|
set -euo pipefail
|
|
go version
|
|
go test ./...
|
|
make build
|
|
ls -la dist/
|
|
'
|