Skip to content

Simplify CI

Simplify CI #200

Workflow file for this run

name: Golang Validation
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
verify-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Detect Go CI-impacting changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
should_run:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'vendor/**'
- '.github/workflows/go-ci.yml'
- name: Set up Go
if: steps.filter.outputs.should_run == 'true'
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Download dependencies
if: steps.filter.outputs.should_run == 'true'
run: go mod download
- name: Verify dependencies are synced
if: steps.filter.outputs.should_run == 'true'
run: |
go mod tidy
go mod vendor
git diff --exit-code -- go.mod go.sum
- name: Build all packages
if: steps.filter.outputs.should_run == 'true'
run: go build ./...
- name: Run unit tests
if: steps.filter.outputs.should_run == 'true'
run: go test ./...