Skip to content

Commit 4162b5f

Browse files
authored
Merge pull request #248 from go-task/improve-github-actions
Improve GitHub Action and also test Go 1.12
2 parents f6c5a46 + 67ae6f2 commit 4162b5f

File tree

1 file changed

+16
-45
lines changed

1 file changed

+16
-45
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,30 @@
11
name: Test
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
4-
linux:
5-
name: Linux
6-
runs-on: ubuntu-latest
4+
test:
5+
name: Test
6+
strategy:
7+
matrix:
8+
go-version: [1.12.x, 1.13.x]
9+
platform: [ubuntu-latest, macos-latest, windows-latest]
10+
runs-on: ${{matrix.platform}}
711
steps:
8-
- name: Set up Go 1.13
12+
- name: Set up Go ${{matrix.go-version}}
913
uses: actions/setup-go@v1
1014
with:
11-
go-version: 1.13
15+
go-version: ${{matrix.go-version}}
1216
id: go
1317

1418
- name: Check out code into the Go module directory
1519
uses: actions/checkout@v1
1620

17-
- name: Build
18-
run: go build -o ./task -v ./cmd/task
19-
20-
- name: Test
21-
run: ./task test
22-
23-
windows:
24-
name: Windows
25-
runs-on: windows-latest
26-
steps:
27-
- name: Set up Go 1.13
28-
uses: actions/setup-go@v1
29-
with:
30-
go-version: 1.13
31-
id: go
32-
33-
- name: Check out code into the Go module directory
34-
uses: actions/checkout@v1
35-
36-
- name: Build
37-
run: go install -v ./cmd/task
38-
39-
- name: Test
40-
run: go test -v ./...
41-
42-
macos:
43-
name: MacOS
44-
runs-on: macOS-latest
45-
steps:
46-
- name: Set up Go 1.13
47-
uses: actions/setup-go@v1
48-
with:
49-
go-version: 1.13
50-
id: go
51-
52-
- name: Check out code into the Go module directory
53-
uses: actions/checkout@v1
21+
- name: Download Go modules
22+
run: go mod download
23+
env:
24+
GOPROXY: https://proxy.golang.org
5425

5526
- name: Build
56-
run: go build -o ./task -v ./cmd/task
27+
run: go build -o ./bin/task -v ./cmd/task
5728

5829
- name: Test
59-
run: ./task test
30+
run: ./bin/task test

0 commit comments

Comments
 (0)