mirror of
https://github.com/hackdiaz-dev/free-turn-proxy.git
synced 2026-10-12 09:41:53 +02:00
109 lines
2.3 KiB
YAML
109 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
GO_VERSION: "1.26.3"
|
|
GOLANGCI_VERSION: v2.12.2
|
|
GOVULN_VERSION: v1.1.4
|
|
GORELEASER_VERSION: v2.15.4
|
|
TASK_VERSION: 3.51.1
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint & format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- uses: actions/setup-go@v6.4.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- uses: arduino/setup-task@v2.0.0
|
|
with:
|
|
version: ${{ env.TASK_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Format check
|
|
run: task fmt:check
|
|
|
|
- name: Vet
|
|
run: task vet
|
|
|
|
- uses: golangci/golangci-lint-action@v9.2.1
|
|
with:
|
|
version: ${{ env.GOLANGCI_VERSION }}
|
|
args: --timeout=5m ./...
|
|
|
|
test:
|
|
name: Test (race)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- uses: actions/setup-go@v6.4.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- uses: arduino/setup-task@v2.0.0
|
|
with:
|
|
version: ${{ env.TASK_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Run tests
|
|
run: task test
|
|
|
|
vuln:
|
|
name: govulncheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- uses: actions/setup-go@v6.4.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- name: Install govulncheck
|
|
run: go install golang.org/x/vuln/cmd/govulncheck@${{ env.GOVULN_VERSION }}
|
|
|
|
- run: govulncheck ./...
|
|
|
|
build-snapshot:
|
|
name: Snapshot build (all targets)
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, test]
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v6.4.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- uses: goreleaser/goreleaser-action@v7.2.2
|
|
with:
|
|
distribution: goreleaser
|
|
version: ${{ env.GORELEASER_VERSION }}
|
|
args: release --snapshot --clean --skip=publish,sign,docker,announce,sbom
|
|
|
|
- uses: actions/upload-artifact@v7.0.1
|
|
with:
|
|
name: snapshot-dist
|
|
path: dist/
|
|
retention-days: 7
|