Files
gpu-turnstile/.gitea/workflows/ci.yml
T
mram 5a0e181293
ci / test (push) Successful in 47s
ci / docker (push) Failing after 23s
CI: build release images only from vX.Y.Z tags
Tests still run on every push. The docker job is gated on ref_type=tag,
validates the tag is a strict vX.Y.Z semver, and publishes :<tag> plus
:latest. No branch images (sha-* / main latest) anymore.
2026-09-20 18:12:00 +02:00

57 lines
1.5 KiB
YAML

name: ci
on:
push:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- run: go vet ./...
- run: go test -race ./...
- name: golangci-lint
run: |
if command -v golangci-lint >/dev/null 2>&1; then
golangci-lint run
else
echo "golangci-lint not available in runner image, skipping"
fi
# Release images are built only from version tags (vX.Y.Z).
docker:
if: gitea.ref_type == 'tag'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check tag is semantic version
run: |
if ! echo "${{ gitea.ref_name }}" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "tag '${{ gitea.ref_name }}' is not a vX.Y.Z semantic version" >&2
exit 1
fi
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: git.rambossek.at
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
push: true
build-args: |
VERSION=${{ gitea.ref_name }}
tags: |
git.rambossek.at/${{ gitea.repository }}:${{ gitea.ref_name }}
git.rambossek.at/${{ gitea.repository }}:latest