Skip to content

Commit f74cae3

Browse files
feat: add Triglav as end-to-end test orchestrator (#154)
* feat: add Triglav as end-to-end test orchestrator * fix: enforce automatic write disable when check mode is enabled --------- Co-authored-by: ChristophShyper <45788587+ChristophShyper@users.noreply.github.com>
1 parent d9c05bf commit f74cae3

7 files changed

Lines changed: 79 additions & 5 deletions

File tree

.github/workflows/auto-pull-request-create.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ on:
99
- dependabot/**
1010

1111
permissions:
12-
contents: read
12+
contents: write
1313
packages: write
1414
pull-requests: write
15+
issues: write
1516

1617
jobs:
1718
call:

.github/workflows/auto-release-create.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ on:
2121
permissions:
2222
contents: write
2323
packages: write
24-
pull-requests: read
24+
pull-requests: write
25+
issues: write
2526

2627
jobs:
2728
call:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: (Manual) E2E Validate
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
mode:
7+
description: Validation mode
8+
required: false
9+
default: image
10+
type: choice
11+
options:
12+
- image
13+
- ref
14+
image_tag:
15+
description: Image tag used when mode=image (for example v1.2.3-test or v1.2.3-rc)
16+
required: false
17+
default: ""
18+
type: string
19+
20+
permissions:
21+
contents: read
22+
packages: read
23+
24+
jobs:
25+
e2e:
26+
uses: devops-infra/triglav/.github/workflows/e2e-action-format-hcl.yml@master
27+
with:
28+
mode: ${{ inputs.mode }}
29+
image_tag: ${{ inputs.image_tag }}
30+
secrets: inherit

.github/workflows/manual-release-branch-prepare.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ permissions:
2727
contents: write
2828
packages: write
2929
pull-requests: write
30+
issues: write
3031

3132
jobs:
3233
call:

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
runs-on: ubuntu-latest
9090
steps:
9191
- name: Checkout
92-
uses: actions/checkout@v5
92+
uses: actions/checkout@v6
9393
9494
- name: Fail on malformatted files
9595
uses: devops-infra/action-format-hcl@v1.1.0
@@ -109,7 +109,7 @@ jobs:
109109
runs-on: ubuntu-latest
110110
steps:
111111
- name: Checkout
112-
uses: actions/checkout@v5
112+
uses: actions/checkout@v6
113113
114114
- name: Format HCL files
115115
uses: devops-infra/action-format-hcl@v1.1.0
@@ -135,7 +135,7 @@ jobs:
135135
format-hcl:
136136
runs-on: ubuntu-latest
137137
steps:
138-
- uses: actions/checkout@v5
138+
- uses: actions/checkout@v6
139139
140140
- uses: devops-infra/action-format-hcl@v1.1.0
141141
id: pin-patch
@@ -162,6 +162,29 @@ If you have any questions or need help, please:
162162
- 📝 Create an [issue](https://github.com/devops-infra/action-format-hcl/issues)
163163
- 🌟 Star this repository if you find it useful!
164164

165+
## 🧪 End-to-End Validation
166+
Use the manual workflow `.github/workflows/manual-e2e-validate.yml` to validate this action against the centralized E2E repository.
167+
168+
- `mode=image` validates a published image tag (recommended for `-test` and `-rc` release checks).
169+
- `mode=ref` validates ref-oriented E2E paths against stable pinned action refs.
170+
171+
CI/CD automation also runs these E2E checks automatically:
172+
173+
- Pull requests: E2E validation runs through reusable org workflows.
174+
- Release branch prepare: E2E validation runs against release candidate artifacts (`-rc`).
175+
- Release create: E2E validation runs against production release artifacts.
176+
177+
Example trigger inputs:
178+
179+
```text
180+
mode=ref
181+
```
182+
183+
```text
184+
mode=image
185+
image_tag=v1.2.3-test
186+
```
187+
165188
## Forking
166189
To publish images from a fork, set these variables so Task uses your registry identities:
167190
`DOCKER_USERNAME`, `DOCKER_ORG_NAME`, `GITHUB_USERNAME`, `GITHUB_ORG_NAME`.

entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ echo " check: ${INPUT_CHECK}"
2525
echo " recursive: ${INPUT_RECURSIVE}"
2626
echo " dir: ${INPUT_DIR}"
2727

28+
if [[ "${INPUT_CHECK}" == "true" && "${INPUT_WRITE}" == "true" ]]; then
29+
echo "[INFO] check=true requires write=false; overriding write to false"
30+
INPUT_WRITE="false"
31+
fi
32+
2833
# Remap input variables as parameters for format-hcl
2934
ARGS=("-list=${INPUT_LIST}" "-write=${INPUT_WRITE}")
3035

tests/docker/local-image.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ commandTests:
1818
- -lc
1919
- INPUT_LIST=false INPUT_WRITE=true INPUT_IGNORE='' INPUT_DIFF=false INPUT_CHECK=false INPUT_RECURSIVE=true INPUT_DIR='' /entrypoint.sh >/tmp/entrypoint.log 2>&1 || (cat /tmp/entrypoint.log && exit 1)
2020

21+
- name: Check mode disables write automatically
22+
command: bash
23+
args:
24+
- -lc
25+
- |
26+
mkdir -p /tmp/check-write-conflict
27+
printf 'locals{a=1}\n' > /tmp/check-write-conflict/main.tf
28+
INPUT_LIST=false INPUT_WRITE=true INPUT_IGNORE='' \
29+
INPUT_DIFF=false INPUT_CHECK=true INPUT_RECURSIVE=true \
30+
INPUT_DIR='/tmp/check-write-conflict' /entrypoint.sh \
31+
>/tmp/check-write.log 2>&1 || (cat /tmp/check-write.log && exit 1)
32+
grep -q 'check=true requires write=false; overriding write to false' /tmp/check-write.log
33+
2134
- name: Apt cache cleaned
2235
command: bash
2336
args:

0 commit comments

Comments
 (0)