Skip to content

Merge pull request #95 from alexandear/fix/typo-test-name #130

Merge pull request #95 from alexandear/fix/typo-test-name

Merge pull request #95 from alexandear/fix/typo-test-name #130

Workflow file for this run

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