mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2025-12-06 07:50:37 +00:00
chore: cleanup CI definition by adding the dimension to the strategy matrix - tofu-wrapper flag.
chore: adjusted version selection test selection. Signed-off-by: Dmitry Kisler <admin@dkisler.com>
This commit is contained in:
parent
fe9ebcfac4
commit
b1f5c5453f
1 changed files with 84 additions and 105 deletions
157
.github/workflows/setup-tofu.yml
vendored
157
.github/workflows/setup-tofu.yml
vendored
|
|
@ -44,7 +44,7 @@ jobs:
|
|||
# strategy:
|
||||
# matrix:
|
||||
# os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
# tofu-versions: [~0.12, 0.12.x, <0.13.0]
|
||||
# tofu-versions: [1.6.0-alpha1]
|
||||
# tofu-wrapper: ["true", "false"]
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
|
|
@ -57,28 +57,74 @@ jobs:
|
|||
# tofu-wrapper: ["true", "false"]
|
||||
#
|
||||
# - name: Validate OpenTofu Version - ${{ matrix['tofu-versions'] }}
|
||||
# run: tofu version | grep 'OpenTofu v0\.12'
|
||||
# run: tofu version | grep 'OpenTofu v1\.6\.0-alpha1'
|
||||
|
||||
# TODO: uncomment when the semver feature is implemented
|
||||
# tofu-versions-constraints-no-wrapper:
|
||||
# name: 'OpenTofu Versions Constraints No Wrapper'
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# matrix:
|
||||
# os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
# tofu-versions: [~0.12, 0.12.x, <0.13.0]
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||
#
|
||||
# - name: Setup OpenTofu (no wrapper) - ${{ matrix['tofu-versions'] }}
|
||||
# uses: ./
|
||||
# with:
|
||||
# tofu_version: ${{ matrix['tofu-versions'] }}
|
||||
# tofu_wrapper: false
|
||||
#
|
||||
# - name: Validate OpenTofu Version - ${{ matrix['tofu-versions'] }}
|
||||
# run: tofu version | grep 'OpenTofu v0\.12'
|
||||
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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||
|
||||
- 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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||
|
||||
- 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'
|
||||
|
|
@ -161,70 +207,3 @@ jobs:
|
|||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
[[ -f ${HOME}/.tofurc ]] || exit 0
|
||||
|
||||
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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||
|
||||
- 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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||
|
||||
- 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 }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue