1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00
gocsaf/.github/workflows/go.yml
Christoph Klassen 12cde3aa3c
Some checks failed
generate-markdown / auto-update-readme (push) Has been cancelled
Go / build (push) Has been cancelled
Go / run_modver (push) Has been cancelled
Merge pull request #637 from gocsaf/api-break-action
Add semver breaking changes detection
2025-06-18 09:04:37 +02:00

62 lines
1.4 KiB
YAML

name: Go
on:
push:
paths:
- "**.go"
pull_request:
paths:
- "**.go"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "stable"
- name: Build
run: go build -v ./cmd/...
- name: vet
run: go vet ./...
- name: gofmt
uses: Jerome1337/gofmt-action@v1.0.4
with:
gofmt-flags: "-l -d"
- name: Revive Action
uses: morphy2k/revive-action@v2.7.4
- name: Tests
run: go test -v ./...
run_modver:
runs-on: ubuntu-latest
needs: build # Only run when build job was successful
if: ${{ github.event_name == 'pull_request' && success() }}
permissions:
contents: read # Modver needs to read the repo content
pull-requests: write # Modver needs to write comments/status on PRs
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Modver needs full history for comparison
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "stable"
- name: Modver
uses: bobg/modver@v2.5.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pull_request_url: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}