Skip to content

Commit

Permalink
Update actions and run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Mar 27, 2024
1 parent 8a93600 commit 350073d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@ jobs:
fail-fast: false
matrix:
go-version: ["1.21", "1.22"]
name: Build ${{ matrix.go-version == '1.22' && '(latest)' || '(old)' }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
export PATH="$HOME/go/bin:$PATH"
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Format
run: if [ "$(goimports -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
if: matrix.go-version == 1.22
- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
export PATH="$HOME/go/bin:$PATH"
- name: Install pre-commit
run: pip install pre-commit

- name: Lint
run: pre-commit run -a

0 comments on commit 350073d

Please sign in to comment.