-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from kislerdm/main
Action v0.0.1
- Loading branch information
Showing
25 changed files
with
22,588 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'Continuous Integration' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
check-dist: | ||
name: Check dist/ directory | ||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@967035ce963867fb956a309c9b67512314bc7c1f | ||
with: | ||
node-version: "20.x" | ||
test: | ||
name: Test | ||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@967035ce963867fb956a309c9b67512314bc7c1f | ||
with: | ||
node-version: "20.x" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
resource "terraform_data" "replacement" { | ||
triggers_replace = timestamp() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
name: 'Setup OpenTofu' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
tofu-versions: | ||
name: 'OpenTofu Versions' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
tofu-versions: [1.6.0-alpha1, latest] | ||
tofu-wrapper: [true, false] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup OpenTofu - ${{ matrix['tofu-versions'] }} | ||
uses: ./ | ||
with: | ||
tofu_version: ${{ matrix['tofu-versions'] }} | ||
tofu_wrapper: ${{ matrix['tofu-wrapper'] }} | ||
|
||
- name: Validate that OpenTofu was installed | ||
run: tofu version | grep 'OpenTofu v' | ||
|
||
- name: Validate the Version ${{ matrix['tofu-versions'] }} was installed | ||
if: ${{ matrix['tofu-versions'] != 'latest' }} | ||
run: tofu version | grep ${{ matrix['tofu-versions']}} | ||
tofu-arguments: | ||
name: 'OpenTofu Arguments' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
tofu-wrapper: [true, false] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup OpenTofu | ||
uses: ./ | ||
with: | ||
tofu_wrapper: ${{ matrix['tofu-wrapper'] }} | ||
|
||
- name: Check No Arguments | ||
run: tofu || exit 0 | ||
|
||
- name: Check Single Argument | ||
run: tofu help || exit 0 | ||
|
||
- name: Check Single Argument Hyphen | ||
run: tofu -help | ||
|
||
- name: Check Single Argument Double Hyphen | ||
run: tofu --help | ||
|
||
- name: Check Single Argument Subcommand | ||
run: tofu fmt -check | ||
|
||
- name: Check Multiple Arguments Subcommand | ||
run: tofu fmt -check -list=true -no-color | ||
tofu-run-local: | ||
name: 'OpenTofu Run Local' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
tofu-wrapper: [true, false] | ||
defaults: | ||
run: | ||
working-directory: ./.github/workflows/data/local | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup OpenTofu | ||
uses: ./ | ||
with: | ||
tofu_wrapper: ${{ matrix['tofu-wrapper'] }} | ||
|
||
- name: OpenTofu Init | ||
run: tofu init | ||
|
||
- name: OpenTofu Format | ||
run: tofu fmt -check | ||
|
||
- name: OpenTofu Plan | ||
id: plan | ||
run: tofu plan | ||
|
||
- name: Print OpenTofu Plan | ||
if: ${{ matrix['tofu-wrapper'] == 'true' }} | ||
run: echo "${{ steps.plan.outputs.stdout }}" | ||
tofu-credentials-cloud: | ||
name: 'OpenTofu Cloud Credentials' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
env: | ||
TF_CLOUD_API_TOKEN: 'XXXXXXXXXXXXXX.atlasv1.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup OpenTofu | ||
uses: ./ | ||
with: | ||
cli_config_credentials_token: ${{ env.TF_CLOUD_API_TOKEN }} | ||
|
||
- name: Validate OpenTofu Credentials (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
cat ${APPDATA}/tofu.rc | grep 'credentials "app.terraform.io"' | ||
cat ${APPDATA}/tofu.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' | ||
- name: Validate Teraform Credentials (Linux & macOS) | ||
if: runner.os != 'Windows' | ||
run: | | ||
cat ${HOME}/.tofurc | grep 'credentials "app.terraform.io"' | ||
cat ${HOME}/.tofurc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' | ||
tofu-credentials-enterprise: | ||
name: 'OpenTofu Enterprise Credentials' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
env: | ||
TF_CLOUD_API_TOKEN: 'XXXXXXXXXXXXXX.atlasv1.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup OpenTofu | ||
uses: ./ | ||
with: | ||
cli_config_credentials_hostname: 'tofu.example.com' | ||
cli_config_credentials_token: ${{ env.TF_CLOUD_API_TOKEN }} | ||
|
||
- name: Validate OpenTofu Credentials (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
cat ${APPDATA}/tofu.rc | grep 'credentials "tofu.example.com"' | ||
cat ${APPDATA}/tofu.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' | ||
- name: Validate Teraform Credentials (Linux & macOS) | ||
if: runner.os != 'Windows' | ||
run: | | ||
cat ${HOME}/.tofurc | grep 'credentials "tofu.example.com"' | ||
cat ${HOME}/.tofurc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' | ||
tofu-credentials-none: | ||
name: 'OpenTofu No Credentials' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup OpenTofu | ||
uses: ./ | ||
|
||
- name: Validate OpenTofu Credentials (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
[[ -f ${APPDATA}/tofu.rc ]] || exit 0 | ||
- name: Validate Teraform Credentials (Linux & macOS) | ||
if: runner.os != 'Windows' | ||
run: | | ||
[[ -f ${HOME}/.tofurc ]] || exit 0 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
node_modules/ | ||
|
||
# Editors | ||
.vscode | ||
.idea/ | ||
.iml | ||
|
||
# Logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Other Dependency directories | ||
jspm_packages/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# ./wrapper/dist gets included in top-level ./dist | ||
wrapper/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint || (npm install && npm run lint) | ||
npm run test | ||
npm audit --audit-level=high | ||
npm run build && git add dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Unreleased | ||
|
||
Initial release. It provides feature parity with the [setup-terraform](https://github.com/hashicorp/setup-terraform) action. |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Each line is a file pattern followed by one or more owners. | ||
# More on CODEOWNERS files: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners | ||
|
||
# We currently do not have any specific code owners | ||
# In the future, we will have a Github team of global code owners of the entire package | ||
# Later on, we will start splitting up the responsibilities, and packages will be assigned more specific code owners | ||
# * @opentofu-code-owners |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Code of Conduct | ||
|
||
We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). | ||
|
||
<!-- TODO: Decide who will handle Code of Conduct reports and replace [INSERT EMAIL ADDRESS] | ||
with an email address in the paragraph below. We recommend using a mailing list to handle reports. | ||
If your project isn't prepared to handle reports, remove the project email address and just have | ||
reporters send to conduct@cncf.io. | ||
--> | ||
Please contact contact@opentf.org in order to report violations of the Code of Conduct. |
Oops, something went wrong.