Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 33 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,48 @@ on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get dependencies
run: |
go get -d -v ./events
go get golang.org/x/lint/golint
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
# The module has no external dependencies, so there is nothing to cache.
cache: false

- name: Build
run: go build -v ./events
run: go build -v ./...

- name: Vet
run: go vet ./...

- name: Test
run: golint ./events
- name: Check formatting
continue-on-error: true
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not gofmt-formatted:"
echo "$unformatted"
exit 1
fi

- name: Static analysis
continue-on-error: true
run: |
go install honnef.co/go/tools/cmd/staticcheck@v0.7.0
staticcheck ./...
Loading