spud/.forgejo/workflows/pull-request.yml
Marc Cataford 24e795e1aa
All checks were successful
Pull-Request / tests (pull_request) Successful in 1m8s
Pull-Request / static-analysis (pull_request) Successful in 1m33s
Pull-Request / post-run (pull_request) Successful in 26s
Push / pre-run (push) Successful in 28s
Push / tests (push) Successful in 1m7s
Push / static-analysis (push) Successful in 1m33s
Push / post-run (push) Successful in 36s
ci: run pre-commit on pr + push
2024-11-10 10:25:33 -05:00

41 lines
1.2 KiB
YAML

name: Pull-Request
on: [pull_request]
jobs:
static-analysis:
runs-on: runner-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Validate Yaml
run: pipx run pre-commit run check-yaml -a
- name: Validate shell scripts
run: pipx run pre-commit run shellcheck -a
- name: Check formatting
run: pipx run pre-commit run go-fmt -a
- name: Check code patterns
run: pipx run pre-commit run go-vet-mod -a
tests:
runs-on: runner-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Tests
run: pipx run pre-commit run go-test-mod -a
post-run:
runs-on: runner-latest
needs: [static-analysis,tests]
if: ${{ always() }}
steps:
- name: Export trace
uses: https://forge.karnov.club/marc/opentelemetry-trace-export-forgejo-action@main
with:
otlp-endpoint: "http://otel.home.karnov.club:4318"
forgejo-token: ${{ secrets.GITHUB_TOKEN }}
forgejo-base-url: ${{ env.GITHUB_SERVER_URL }}
run-id: ${{ env.GITHUB_RUN_NUMBER }}
repo-name: ${{ env.GITHUB_REPOSITORY }}