-
Notifications
You must be signed in to change notification settings - Fork 62
43 lines (36 loc) · 1.08 KB
/
test.yml
File metadata and controls
43 lines (36 loc) · 1.08 KB
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
name: Test
on:
workflow_call:
workflow_dispatch:
pull_request:
permissions:
contents: write
jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
token: ${{ secrets.HCP_SDK_PIPELINE_TOKEN }}
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
cache: true
go-version-file: 'go.mod'
cache-dependency-path: go.sum
- name: Install Dependencies
env:
GOPRIVATE: 'github.com/hashicorp/*'
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
go mod tidy
- name: Run Unit Tests and Linter
run: make test-ci
- name: Upload Unit Test Coverage Artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: Test Coverage
path: coverage.html