Skip to content

fix: remove go-vet from prek hooks (already run by CI vet step) #4

fix: remove go-vet from prek hooks (already run by CI vet step)

fix: remove go-vet from prek hooks (already run by CI vet step) #4

Workflow file for this run

name: Go CI
on:
pull_request:
branches: ["**"]
push:
branches: ["**"]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-build:
runs-on: ubuntu-latest
env:
GOFLAGS: -buildvcs=false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Download deps
run: go mod tidy
- name: Verify go.mod/go.sum unchanged
run: |
git diff --exit-code go.mod go.sum
- name: Check formatting
run: |
unformatted=$(gofmt -l ./cmd ./pkg)
if [ -n "$unformatted" ]; then
echo "Unformatted files:"
echo "$unformatted"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Setup Python (for prek)
if: ${{ hashFiles('prek.toml') != '' || hashFiles('.pre-commit-config.yaml') != '' || hashFiles('.pre-commit-config.yml') != '' }}
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install prek
if: ${{ hashFiles('prek.toml') != '' || hashFiles('.pre-commit-config.yaml') != '' || hashFiles('.pre-commit-config.yml') != '' }}
run: |
python -m pip install --upgrade pip
python -m pip install prek
prek --version
- name: Pre-commit checks (prek)
if: ${{ hashFiles('prek.toml') != '' || hashFiles('.pre-commit-config.yaml') != '' || hashFiles('.pre-commit-config.yml') != '' }}
run: |
prek validate-config
prek run --all-files
- name: Unit tests
run: go test ./... -count=1
- name: Build
run: go build -v ./cmd/substack