sabisan/.gitea/workflows/ci.yml
V c8692d4348
Some checks failed
Publish / Lint and test (push) Successful in 1m7s
Publish / Build and push image (push) Failing after 1s
Hardcode Gitea checkout host in workflows
2026-05-16 21:42:46 +01:00

43 lines
1000 B
YAML

name: CI
on:
push:
branches-ignore:
- main
jobs:
lint-test:
name: Lint and test
runs-on: ubuntu-latest
container:
image: golang:1.24-bookworm
steps:
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
set -eu
git init .
if [ -n "${TOKEN:-}" ]; then
git remote add origin "https://x-access-token:${TOKEN}@k3gtpi.jumpingcrab.com/${GITHUB_REPOSITORY}.git"
else
git remote add origin "https://k3gtpi.jumpingcrab.com/${GITHUB_REPOSITORY}.git"
fi
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout --detach FETCH_HEAD
- name: Check formatting
run: |
files="$(gofmt -l .)"
if [ -n "$files" ]; then
echo "The following files need gofmt:"
echo "$files"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...