-
Notifications
You must be signed in to change notification settings - Fork 30
97 lines (93 loc) · 2.85 KB
/
terraform-ci.yml
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
87
88
89
90
91
92
93
94
95
96
97
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
name: terraform-ci
on:
push:
branches:
- 'main'
- 'release/**'
pull_request:
branches:
- 'main'
- 'release/**'
permissions: {}
jobs:
action-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Lint workflow
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest
with:
# we need to ignore the SC2086 rule to pass unescaped $VARS to the terraform commands
args: -ignore SC2086
get-go-version:
uses: ./.github/workflows/reusable-get-go-version.yml
go-fmt-and-lint-acceptance:
needs:
- get-go-version
uses: ./.github/workflows/reusable-go-fmt-and-lint.yml
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
terraform-fmt:
needs:
- action-lint
uses: ./.github/workflows/reusable-terraform-fmt.yml
acceptance-fargate:
needs:
- get-go-version
- terraform-fmt
- go-fmt-and-lint-acceptance
strategy:
# We have a limit of 6 HCP Consul clusters.
# The following controls whether to enable HCP when testing release branches.
# HCP is always disabled for tests on PRs.
matrix:
name:
- acceptance-1.17-FARGATE-HCP
- acceptance-1.18-FARGATE
include:
- name: acceptance-1.17-FARGATE-HCP
enable-hcp: true
launch-type: FARGATE
- name: acceptance-1.18-FARGATE
enable-hcp: false
launch-type: FARGATE
consul-version: 1.18.0-rc1
fail-fast: false
uses: ./.github/workflows/reusable-ecs-acceptance.yml
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
name: ${{ matrix.name }}
launch-type: ${{ matrix.launch-type }}
enable-hcp: ${{ matrix.enable-hcp }}
secrets: inherit
acceptance-ec2:
needs:
- get-go-version
- acceptance-fargate
strategy:
# We have a limit of 6 HCP Consul clusters.
# The following controls whether to enable HCP when testing release branches.
# HCP is always disabled for tests on PRs.
matrix:
name:
- acceptance-1.17-EC2-HCP
- acceptance-1.18-EC2
include:
- name: acceptance-1.17-EC2-HCP
enable-hcp: true
launch-type: EC2
- name: acceptance-1.18-EC2
enable-hcp: false
launch-type: EC2
consul-version: 1.18.0-rc1
fail-fast: false
uses: ./.github/workflows/reusable-ecs-acceptance.yml
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
name: ${{ matrix.name }}
launch-type: ${{ matrix.launch-type }}
enable-hcp: ${{ matrix.enable-hcp }}
secrets: inherit