-
Notifications
You must be signed in to change notification settings - Fork 6
86 lines (82 loc) · 3.31 KB
/
validate.yml
File metadata and controls
86 lines (82 loc) · 3.31 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: validate
# NOTE ** READ ME ** NOTE
# This workflow is intended to be imported and called by other workflows.
# As such, the important things that you need to know if you're modifying
# this file are:
#
# If you need a secret in this file you need to pass them from the caller
# workflow into this. You do this by configuring secrets as if they are input
# down below in the secrets stanza. You then need to update every calling
# workflow to pass in the secrets.
on:
workflow_call:
inputs:
artifact-name:
required: true
type: string
jobs:
static-analysis:
name: "Format"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- uses: ./.github/actions/set-up-buf
- uses: ./.github/actions/set-up-gofumpt
- uses: ./.github/actions/set-up-golangci-lint
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
# the terraform wrapper will break terraform execution in enos because
# it changes the output to text when we expect it to be JSON.
terraform_wrapper: false
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: ${{inputs.artifact-name }}
- name: unzip
run: |
ls -l ${{inputs.artifact-name }}
unzip ${{inputs.artifact-name }} -d dist
- name: fmt-check
run: make fmt-check
- name: lint
run: make lint
test:
name: Go tests
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
# the terraform wrapper will break terraform execution in enos because
# it changes the output to text when we expect it to be JSON.
terraform_wrapper: false
- uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0
with:
# The github actions service user creds for this account managed in hashicorp/enos-ci
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_09042025 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_09042025 }}
aws-region: "us-east-1"
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-skip-session-tagging: true
- name: Setup Enos SSH Keys
id: sshkey
run: |
mkdir -p ./acceptance/support
echo "${{ secrets.ENOS_CI_SSH_PRIVATE_KEY }}" > ./acceptance/support/private_key.pem
chmod 600 ./acceptance/support/private_key.pem
- name: Download Artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: ${{inputs.artifact-name }}
- name: Run all Go tests (unit, acceptance, external deps)
run: |
ls -l ${{inputs.artifact-name }}
unzip ${{inputs.artifact-name }} -d dist
make test-acc-ext