-
Notifications
You must be signed in to change notification settings - Fork 62
115 lines (96 loc) · 3.2 KB
/
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: ci
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Build Docker image
run: |
VERSION=$(grep "docker://quay.io/terraform-docs/gh-actions" action.yml | cut -d: -f4 | sed 's/"//g')
docker build --pull --tag quay.io/terraform-docs/gh-actions:${VERSION} .
- name: Should generate USAGE.md for tf11_basic
uses: ./
with:
working-dir: examples/tf11_basic
output-file: USAGE.md
template: |-
<!-- BEGIN_TF_DOCS -->
# Test tf11 basic
## Verify
Should use the template defined instead of the default
Should inject the table under usage
# Usage
{{ .Content }}
<!-- END_TF_DOCS -->
indention: 3
- name: Should generate USAGE.md for tf11_extra_args
uses: ./
with:
working-dir: examples/tf11_extra_args
output-format: markdown document
output-file: USAGE.md
output-method: replace
args: --sensitive=false --hide requirements --required=false
indention: 3
- name: Should generate README.md for tf12_bsic
uses: ./
with:
working-dir: examples/tf12_basic
indention: 3
- name: Should generate README.md for tf12_atlantis
uses: ./
with:
atlantis-file: atlantis.yaml
args: --hide providers
indention: 3
- name: Should generate USAGE.md for tf12_find and its submodules
uses: ./
with:
find-dir: examples/tf12_find
output-file: USAGE.md
- name: Should generate USAGE.md for tf12_find and its submodules recursively
uses: ./
with:
working-dir: examples/tf12_find
output-file: USAGE.md
recursive: true
recursive-path: modules
- name: Should generate README.md for tf12_config
uses: ./
with:
working-dir: examples/tf12_config
config-file: .terraform-docs.yml
- name: Should generate README.md for tf12_inject and push up all changes
uses: ./
with:
working-dir: examples/tf12_inject
args: --sort-by required
indention: 3
git-push: true
git-push-sign-off: true
git-commit-message: "terraform-docs: automated action"
- name: Should generate README.md for tf12_fail_diff and fail on diff
uses: ./
with:
working-dir: examples/tf12_fail_diff
indention: 3
fail-on-diff: true
format:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform format
uses: hashicorp/setup-terraform@v3
with:
terraform_version: '0.12.17'
- run: terraform fmt examples