Merge pull request #95 from alexandear/fix/typo-test-name #130
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
name: Go | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ '1.22', '1.19' ] | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: use cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Download Modules | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: go mod download | |
- name: Build | |
run: go build -o ./bin/gocloc cmd/gocloc/main.go | |
- name: Check imports | |
shell: bash | |
run: | | |
export PATH=$(go env GOPATH)/bin:$PATH | |
go get golang.org/x/tools/cmd/goimports | |
diff -u <(echo -n) <(goimports -d .) | |
- name: Test | |
run: go test -v |