ci(forgejo): add Actions for test, build, and releases
Some checks are pending
CI / Test, vet, build (push) Waiting to run
Some checks are pending
CI / Test, vet, build (push) Waiting to run
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.
This commit is contained in:
parent
58b29a7f84
commit
5983a7df5a
2 changed files with 148 additions and 0 deletions
41
.forgejo/workflows/ci.yml
Normal file
41
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Host-mode runner: Go via official image.
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: tarakan-client-ci-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
name: Test, vet, build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Go check
|
||||
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 -count=1 ./...
|
||||
go vet ./...
|
||||
make build
|
||||
ls -la bin/tarakan
|
||||
'
|
||||
Loading…
Add table
Add a link
Reference in a new issue