Skip to content

Commit d24876f

Browse files
authored
refactor: go test workflows (#599)
- Updated GitHub Actions workflows for macOS, Linux, and Windows to improve naming consistency, add step names, and clarify comments. - Removed license headers and standardized formatting for better readability and maintainability. Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
1 parent 5608c28 commit d24876f

3 files changed

Lines changed: 36 additions & 45 deletions

File tree

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
#
2-
# Copyright (c) HashiCorp, Inc.
3-
# SPDX-License-Identifier: MPL-2.0
1+
---
2+
# This GitHub action runs Packer go tests across macOS runners.
43

5-
# This GitHub action runs Packer go tests across
6-
# MacOS runners.
7-
#
8-
9-
name: "Go Test MacOS"
4+
name: Go Test macOS
105

116
on:
127
push:
138
branches:
14-
- 'main'
9+
- main
1510
pull_request:
1611

1712
permissions:
@@ -23,8 +18,9 @@ jobs:
2318
outputs:
2419
go-version: ${{ steps.get-go-version.outputs.go-version }}
2520
steps:
26-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27-
- name: 'Determine Go version'
21+
- name: Checkout Repository
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- name: Get Go Version
2824
id: get-go-version
2925
run: |
3026
echo "Found Go $(cat .go-version)"
@@ -33,14 +29,14 @@ jobs:
3329
needs:
3430
- get-go-version
3531
runs-on: macos-latest
36-
name: Darwin Go tests
32+
name: Darwin Go Tests
3733
steps:
38-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39-
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
34+
- name: Checkout Repository
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36+
- name: Setup Go
37+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4038
with:
4139
go-version: ${{ needs.get-go-version.outputs.go-version }}
4240
- run: |
4341
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
4442
go test -race -count 1 ./... -timeout=3m
45-
46-

.github/workflows/go-test-linux.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
# Copyright (c) HashiCorp, Inc.
2-
# SPDX-License-Identifier: MPL-2.0
1+
---
2+
# This GitHub action runs Packer go tests across Linux runners.
33

4-
#
5-
# This GitHub action runs Packer go tests across
6-
# Linux runners.
7-
#
8-
9-
name: "Go Test Linux"
4+
name: Go Test Linux
105

116
on:
127
push:
138
branches:
14-
- 'main'
9+
- main
1510
pull_request:
1611

1712
permissions:
@@ -23,8 +18,9 @@ jobs:
2318
outputs:
2419
go-version: ${{ steps.get-go-version.outputs.go-version }}
2520
steps:
26-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27-
- name: 'Determine Go version'
21+
- name: Checkout Repository
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- name: Get Go Version
2824
id: get-go-version
2925
run: |
3026
echo "Found Go $(cat .go-version)"
@@ -33,10 +29,12 @@ jobs:
3329
needs:
3430
- get-go-version
3531
runs-on: ubuntu-latest
36-
name: Linux Go tests
32+
name: Linux Go Tests
3733
steps:
38-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39-
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
34+
- name: Checkout Repository
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36+
- name: Setup Go
37+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4038
with:
4139
go-version: ${{ needs.get-go-version.outputs.go-version }}
4240
- run: |
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
# Copyright (c) HashiCorp, Inc.
2-
# SPDX-License-Identifier: MPL-2.0
1+
---
2+
# This GitHub action runs Packer go tests across Windows runners.
33

4-
#
5-
# This GitHub action runs Packer go tests across
6-
# Windows runners.
7-
#
8-
9-
name: "Go Test Windows"
4+
name: Go Test Windows
105

116
on:
127
push:
138
branches:
14-
- 'main'
9+
- main
1510
pull_request:
1611

1712
permissions:
@@ -23,8 +18,9 @@ jobs:
2318
outputs:
2419
go-version: ${{ steps.get-go-version.outputs.go-version }}
2520
steps:
26-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27-
- name: 'Determine Go version'
21+
- name: Checkout Repository
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- name: Get Go Version
2824
id: get-go-version
2925
run: |
3026
echo "Found Go $(cat .go-version)"
@@ -33,13 +29,14 @@ jobs:
3329
needs:
3430
- get-go-version
3531
runs-on: windows-latest
36-
name: Windows Go tests
32+
name: Windows Go Tests
3733
steps:
38-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39-
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
34+
- name: Checkout Repository
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36+
- name: Setup Go
37+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4038
with:
4139
go-version: ${{ needs.get-go-version.outputs.go-version }}
4240
- run: |
4341
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
4442
go test -race -count 1 ./... -timeout=3m
45-

0 commit comments

Comments
 (0)