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:
|
# strategy:
|
||||||
# matrix:
|
# matrix:
|
||||||
# os: [ubuntu-latest, windows-latest, macos-latest]
|
# 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"]
|
# tofu-wrapper: ["true", "false"]
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Checkout
|
# - name: Checkout
|
||||||
|
|
@ -57,28 +57,74 @@ jobs:
|
||||||
# tofu-wrapper: ["true", "false"]
|
# tofu-wrapper: ["true", "false"]
|
||||||
#
|
#
|
||||||
# - name: Validate OpenTofu Version - ${{ matrix['tofu-versions'] }}
|
# - 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-arguments:
|
||||||
# tofu-versions-constraints-no-wrapper:
|
name: 'OpenTofu Arguments'
|
||||||
# name: 'OpenTofu Versions Constraints No Wrapper'
|
runs-on: ${{ matrix.os }}
|
||||||
# runs-on: ${{ matrix.os }}
|
strategy:
|
||||||
# strategy:
|
matrix:
|
||||||
# matrix:
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
# os: [ubuntu-latest, windows-latest, macos-latest]
|
tofu-wrapper: ["true", "false"]
|
||||||
# tofu-versions: [~0.12, 0.12.x, <0.13.0]
|
steps:
|
||||||
# steps:
|
- name: Checkout
|
||||||
# - name: Checkout
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||||
# uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
|
||||||
#
|
- name: Setup OpenTofu
|
||||||
# - name: Setup OpenTofu (no wrapper) - ${{ matrix['tofu-versions'] }}
|
uses: ./
|
||||||
# uses: ./
|
with:
|
||||||
# with:
|
tofu_wrapper: ${{ matrix['tofu-wrapper'] }}
|
||||||
# tofu_version: ${{ matrix['tofu-versions'] }}
|
|
||||||
# tofu_wrapper: false
|
- name: Check No Arguments
|
||||||
#
|
run: tofu || exit 0
|
||||||
# - name: Validate OpenTofu Version - ${{ matrix['tofu-versions'] }}
|
|
||||||
# run: tofu version | grep 'OpenTofu v0\.12'
|
- 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:
|
tofu-credentials-cloud:
|
||||||
name: 'OpenTofu Cloud Credentials'
|
name: 'OpenTofu Cloud Credentials'
|
||||||
|
|
@ -161,70 +207,3 @@ jobs:
|
||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows'
|
||||||
run: |
|
run: |
|
||||||
[[ -f ${HOME}/.tofurc ]] || exit 0
|
[[ -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