-
Notifications
You must be signed in to change notification settings - Fork 6
59 lines (56 loc) · 1.69 KB
/
Copy pathvalidate.yml
File metadata and controls
59 lines (56 loc) · 1.69 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
name: Validate Templates
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate set "debug_enabled"'
type: boolean
required: false
default: false
jobs:
validate:
name: Validate (${{ matrix.template }})
runs-on: ubuntu-latest
strategy:
matrix:
template: [user-defined-web, drupal-core, freeform]
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: hashicorp/setup-terraform@v4
with:
terraform_version: "~1.9"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Init
run: terraform init -backend=false -input=false
working-directory: ${{ matrix.template }}
- name: Validate
run: terraform validate
working-directory: ${{ matrix.template }}
- name: Test
run: terraform test
working-directory: ${{ matrix.template }}
fmt:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: hashicorp/setup-terraform@v4
with:
terraform_version: "~1.9"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Check formatting
run: terraform fmt -check -recursive