Files
go-semrel-provider/.github/workflows/ci.yml
Izrafil Archimedes 4808475a39
Some checks failed
CI / build (push) Has been cancelled
CI / release (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
chore: allow init dev version in ci
2026-02-23 09:42:06 +01:00

88 lines
2.0 KiB
YAML

name: CI
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
- name: Run lint
run: make lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Install gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run tests
run: |
set -euo pipefail
go test -json -race -covermode=atomic -coverprofile=coverage.out ./pkg/... 2>&1 | tee /tmp/gotest.log | gotestfmt
build:
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Build
run: make build
release:
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Build and install provider-zexlab plugin
run: |
go build -o provider-zexlab ./cmd/provider-zexlab/
PLUGIN_DIR=".semrel/$(go env GOOS)_$(go env GOARCH)/provider-zexlab/0.0.0-dev"
mkdir -p "$PLUGIN_DIR"
mv provider-zexlab "$PLUGIN_DIR/provider-zexlab"
chmod +x "$PLUGIN_DIR/provider-zexlab"
- uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.ZX_TOKEN }}
hooks: goreleaser
allow-initial-development-versions: true
custom-arguments: "--provider zexlab"
env:
GITEA_TOKEN: ${{ secrets.ZX_TOKEN }}