Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow examples with tenv and tofu #193

Merged
merged 38 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a9a977a
bump v10 release
rdhar Apr 3, 2024
4ad3498
add tofu example
rdhar Apr 3, 2024
8ef515b
add tofu example via tenv
rdhar Apr 3, 2024
364e218
move tf via pr workflows to examples directrory to prevent mistrigger
rdhar Apr 3, 2024
6cc795b
add explicit check for terraform cli path
rdhar Apr 3, 2024
e645c7d
replace `tenv` with `tofu` in "comments or input" example
rdhar Apr 3, 2024
2e4ee8a
add `tenv` to tf tests workflow with multiple tf tools execution simu…
rdhar Apr 3, 2024
5fd052e
Merge branch 'main' into tenv-examples
rdhar Apr 3, 2024
adfe13f
revert to initial setup step to reproduce tf test results
rdhar Apr 3, 2024
44aa0a8
replace tool-specific setup steps with `tenv`
rdhar Apr 3, 2024
e9d35ca
remove unnecessary comment
rdhar Apr 3, 2024
66fee40
revert extraneous changes
rdhar Apr 3, 2024
debf121
revert move of example workflows
rdhar Apr 3, 2024
24f7932
Merge branch 'main' into tenv-examples
rdhar Apr 3, 2024
58e0dba
Merge branch 'main' into tenv-examples
rdhar Apr 3, 2024
d930bdc
replace `TENV_TOOL` with `CLI_USES` thanks to tenv@v1.5.0
rdhar Apr 4, 2024
4d20ead
tidy release tags
rdhar Apr 4, 2024
85c2c57
fix cosign latest tag reference format
rdhar Apr 4, 2024
c79d3b1
trigger workflow
rdhar Apr 5, 2024
1d45fdd
trigger
rdhar Apr 5, 2024
4c74e27
replace `tenv ... install` with `tenv ... use`
rdhar Apr 5, 2024
a5f9ca0
use v1.6.1 instead of latest
rdhar Apr 5, 2024
9654d83
get tenv tf version
rdhar Apr 8, 2024
7aa3e9a
run multiline yaml command
rdhar Apr 8, 2024
c2104f3
echo tenv update-path
rdhar Apr 8, 2024
4003d0b
add dquotes
rdhar Apr 8, 2024
f23f73e
remove dquotes
rdhar Apr 8, 2024
9df967a
only update-path
rdhar Apr 8, 2024
9e69bd3
tidy up
rdhar Apr 9, 2024
a8495e8
remove version test step
rdhar Apr 9, 2024
623a983
test `tenv constraint`
rdhar Apr 9, 2024
c599b60
test constraint
rdhar Apr 9, 2024
bbfc028
fix line
rdhar Apr 9, 2024
ee6bcae
replace `tenv constraint` with `install`
rdhar Apr 9, 2024
b6ccabf
docs: add entry under examples for `tenv` usage scenario
rdhar Apr 9, 2024
9affb66
ci: remove version logging step
rdhar Apr 9, 2024
87c72f1
ci: add path-filter to tests workflow trigger
rdhar Apr 9, 2024
655d734
ci: substitute `CLI_VERSION`
rdhar Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/tf_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: TF Tests
on:
pull_request:
types: [opened, reopened, synchronize, closed]
paths:
- "**.yml"
- "scripts/**"
- "tests/**"

jobs:
tests:
Expand Down Expand Up @@ -31,9 +35,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup TF
uses: opentofu/setup-opentofu@ae80d4ecaab946d8f5ff18397fbf6d0686c6d46a # v1.0.3
- uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
- name: Setup TF (via tenv)
env:
CLI_USES: ${{ matrix.cli_uses }}
CLI_VERSION: ~> 1.6.0
run: |
VERSION=$(curl --silent https://api.github.com/repos/tofuutils/tenv/releases/latest | jq -r .tag_name)
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${VERSION}_amd64.deb"
sudo dpkg -i "tenv_${VERSION}_amd64.deb"
tenv $CLI_USES install "$CLI_VERSION" && tenv update-path

- name: Provision TF
id: tf
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@
Functional workflow examples are provided below, along with associated permissions and triggers. The full list of inputs is documented [below](#inputs).

- [TF via PR Comments](.github/examples/tf_via_pr_comments.yml)
- [TF via PR Comments or Input](.github/examples/tf_via_pr_comments_or_input.yml)
- [TF via PR Input with AWS Authentication](.github/examples/tf_via_pr_input.yml)
- [TF via PR Input with Matrix Strategy](.github/examples/tf_via_pr_input_matrix.yml)
- [TF via PR Comments or Input](.github/examples/tf_via_pr_comments_or_input.yml)
- [TF via PR Input with `tenv` Proxy](.github/workflows/tf_tests.yml)

> [!NOTE]
>
Expand Down
Loading