-
Notifications
You must be signed in to change notification settings - Fork 55
57 lines (47 loc) · 1.33 KB
/
prerequisites.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Check prerequisites
on: [push, pull_request]
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Install goimports
run: go get golang.org/x/tools/cmd/goimports
- name: Checkout the repository
uses: actions/checkout@v2
# Comment this out for now until amppackager passes goimports.
# https://github.com/ampproject/amppackager/issues/506
# - name: Check formatting with goimports
# run: |
# if $(go env GOPATH)/bin/goimports -d . | grep . ; then
# exit 1
# fi
go-vet:
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Checkout the repository
uses: actions/checkout@v2
- name: Diagnose the code with go vet
# TODO(banaag): Turn on composite checking when
# https://github.com/ampproject/amppackager/issues/507 is fixed.
run: go vet -composites=false ./...
go-test:
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run the tests
run: make test
- name: Run the build
run: make build