generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (52 loc) · 1.46 KB
/
go-test.yaml
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
#
# This GitHub action runs Packer go tests across
# Windows, Linux, and MacOS runners.
#
name: "Go Test"
on:
- workflow_dispatch
- pull_request
permissions:
contents: read
jobs:
get-go-version:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@v3
- name: 'Determine Go version'
id: get-go-version
run: |
echo "Building with Go $(cat .go-version)"
echo "::set-output name=go-version::$(cat .go-version)"
linux-go-tests:
runs-on: ubuntu-latest
needs: get-go-version
name: Linux Go tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: go test -race -count 1 ./... -timeout=3m
darwin-go-tests:
runs-on: macos-latest
needs: get-go-version
name: Darwin Go tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: go test -race -count 1 ./... -timeout=3m
windows-go-tests:
runs-on: windows-latest
needs: get-go-version
name: Windows Go tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: go test -race -count 1 ./... -timeout=3m