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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Go Continuous Integration
on: [push, pull_request]
jobs:

build:
name: Build
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}/go
strategy:
matrix:
go: [1.11, 1.12, 1.13]
steps:

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

- name: Check out code into GOPATH
uses: actions/checkout@v2
with:
path: go/src/firebase.google.com/go

- name: Get dependencies
run: go get -t -v $(go list ./... | grep -v integration)

- name: Run Linter
run: |
go get golang.org/x/lint/golint
$GOPATH/bin/golint -set_exit_status firebase.google.com/go/...

- name: Run Unit Tests
if: success() || failure()
run: go test -v -race -test.short firebase.google.com/go/...

- name: Run Formatter
working-directory: ./go/src/firebase.google.com/go
if: matrix.go != '1.11'
run: |
if [[ ! -z "$(gofmt -l -s .)" ]]; then
echo "Go code is not formatted:"
gofmt -d -s .
exit 1
fi

- name: Run Static Analyzer
run: go vet -v firebase.google.com/go/...