3c43f1bd80
schemas / vulnerabilities (pull_request) Successful in 2m19s
pre-commit / pre-commit (pull_request) Successful in 11m12s
schemas / check-release (pull_request) Successful in 14m14s
schemas / check (pull_request) Successful in 19m52s
schemas / build (pull_request) Successful in 7m24s
schemas / deploy-prod (pull_request) Has been skipped
95 lines
2.4 KiB
YAML
95 lines
2.4 KiB
YAML
name: schemas
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
inputs:
|
|
deploy_prod:
|
|
description: 'Deploy to production'
|
|
required: false
|
|
default: 'false'
|
|
type: boolean
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 'stable'
|
|
- name: Generate and format check
|
|
run: |
|
|
go install mvdan.cc/gofumpt@latest
|
|
go install golang.org/x/tools/cmd/goimports@latest
|
|
go generate ./...
|
|
git diff --stat --exit-code
|
|
- name: Run tests
|
|
run: go test -race -coverprofile=coverage.txt ./...
|
|
|
|
vulnerabilities:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 'stable'
|
|
- name: Check vulnerabilities
|
|
run: |
|
|
go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
govulncheck ./...
|
|
|
|
check-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 'stable'
|
|
- name: Check goreleaser config
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: '~> v2'
|
|
args: check
|
|
- name: Test release build
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: '~> v2'
|
|
args: release --snapshot --clean
|
|
|
|
build:
|
|
needs: [check, vulnerabilities, check-release]
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BUILDTOOLS_CONTENT: ${{ secrets.BUILDTOOLS_CONTENT }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: buildtool/setup-buildtools-action@v1
|
|
- name: Build and push
|
|
run: unset GITEA_TOKEN && build && push
|
|
|
|
deploy-prod:
|
|
needs: build
|
|
if: gitea.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BUILDTOOLS_CONTENT: ${{ secrets.BUILDTOOLS_CONTENT }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: buildtool/setup-buildtools-action@v1
|
|
- name: Deploy to production
|
|
run: deploy prod
|