gofmt: Log the gofmt output when it fails in CI #48
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: quay.io/centos/centos:stream9 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: | | |
set -xeuo pipefail | |
dnf -y install 'dnf-command(config-manager)' | |
dnf -y config-manager --set-enabled crb | |
dnf -y install go-toolset libvirt-devel | |
# Because all the git clones are much less reliable | |
export GOPROXY=https://proxy.golang.org | |
go install github.com/onsi/ginkgo/v2/ginkgo@latest | |
make GOOPTS=-buildvcs=false | |
export PATH=$PATH:$HOME/go/bin | |
make integration_tests | |
- name: lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.2 | |
export PATH=$PATH:$HOME/go/bin | |
make lint | |
- name: gofmt | |
run: | | |
if [ $(test -z $(gofmt -l .)) ]; then exit 0; else gofmt -d -e . && exit 1; fi |