Skip to content

Commit e53d695

Browse files
author
Luca Prete
committed
Fixes
1 parent fcb75d0 commit e53d695

File tree

1 file changed

+20
-31
lines changed

1 file changed

+20
-31
lines changed

.github/workflows/tests-new.yml

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,33 @@ on:
2424
- cron: '0 3 * * *'
2525
workflow_dispatch:
2626
inputs:
27+
python_version:
28+
description: "Use Python 3.12"
29+
required: true
30+
default: 3.12
31+
type: string
2732
terraform_version:
2833
description: "Use Terraform 11.4"
2934
required: true
3035
default: 1.11.4
3136
type: string
37+
tofu_version:
38+
description: "Use OpenTofu 1.9.0"
39+
required: true
40+
default: 1.9.0
41+
type: string
3242

3343
env:
44+
DEFAULT_TERRAFORM_FLAVOUR: terraform
45+
DEFAULT_TERRAFORM_VERSION: ${{ inputs.terraform_version || '1.11.4' }}
46+
DEFAULT_TOFU_VERSION: ${{ inputs.tofu_version || '1.9.0' }}
3447
GOOGLE_APPLICATION_CREDENTIALS: "/home/runner/credentials.json"
3548
PYTEST_ADDOPTS: "--color=yes"
36-
PYTHON_VERSION: "3.12"
49+
PYTHON_VERSION: ${{ inputs.python_version || '3.12' }}
3750
TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache"
3851
TFTEST_COPY: 1
39-
DEFAULT_TERRAFORM_FLAVOUR: terraform
40-
DEFAULT_TERRAFORM_VERSION: ${{ inputs.terraform_version || '1.11.4' }}
41-
DEFAULT_TOFU_VERSION: "1.9.0"
4252

4353
jobs:
44-
compute-matrix:
45-
runs-on: ubuntu-latest
46-
outputs:
47-
DEFAULT_TERRAFORM_FLAVOUR: ${{ env.DEFAULT_TERRAFORM_FLAVOUR }}
48-
DEFAULT_TERRAFORM_VERSION: ${{ env.DEFAULT_TERRAFORM_VERSION }}
49-
DEFAULT_TOFU_VERSION: ${{ env.DEFAULT_TOFU_VERSION }}
50-
steps:
51-
- name: Setup TF provider versions
52-
run: echo "Set Terraform provider versions"
53-
54-
- name: Set up uv and python
55-
uses: astral-sh/setup-uv@v6
56-
with:
57-
python-version: ${{ inputs.PYTHON_VERSION }}
58-
enable-cache: true
59-
cache-dependency-glob: |
60-
./pyproject.toml
61-
./uv.lock
62-
6354
get-latest-tag:
6455
runs-on: ubuntu-latest
6556
outputs:
@@ -86,22 +77,21 @@ jobs:
8677
setup-tf-providers:
8778
runs-on: ubuntu-latest
8879
needs:
89-
- compute-matrix
9080
- get-latest-tag
9181
strategy:
9282
matrix:
9383
include:
9484
- flavour: terraform
95-
version: "${{ needs.compute-matrix.outputs.DEFAULT_TERRAFORM_VERSION }}"
85+
version: "${{ env.DEFAULT_TERRAFORM_VERSION }}"
9686
- flavour: tofu
97-
version: "${{ needs.compute-matrix.outputs.DEFAULT_TOFU_VERSION }}"
87+
version: "${{ env.DEFAULT_TOFU_VERSION }}"
9888
steps:
9989
- uses: actions/checkout@v4
10090

10191
- name: Set up uv and python
10292
uses: astral-sh/setup-uv@v6
10393
with:
104-
python-version: ${{ inputs.PYTHON_VERSION }}
94+
python-version: ${{ env.PYTHON_VERSION }}
10595
enable-cache: true
10696
cache-dependency-glob: |
10797
./pyproject.toml
@@ -155,25 +145,24 @@ jobs:
155145
tests:
156146
runs-on: ubuntu-latest
157147
needs:
158-
- compute-matrix
159148
- get-latest-tag
160149
- setup-tf-providers
161150

162151
strategy:
163152
matrix:
164153
include:
165154
- flavour: terraform
166-
version: "${{ needs.compute-matrix.outputs.DEFAULT_TERRAFORM_VERSION }}"
155+
version: "${{ env.DEFAULT_TERRAFORM_VERSION }}"
167156
- flavour: tofu
168-
version: "${{ needs.compute-matrix.outputs.DEFAULT_TOFU_VERSION }}"
157+
version: "${{ env.DEFAULT_TOFU_VERSION }}"
169158

170159
steps:
171160
- uses: actions/checkout@v4
172161

173162
- name: Set up uv and python
174163
uses: astral-sh/setup-uv@v6
175164
with:
176-
python-version: ${{ inputs.PYTHON_VERSION }}
165+
python-version: ${{ env.PYTHON_VERSION }}
177166
enable-cache: true
178167
cache-dependency-glob: |
179168
./pyproject.toml

0 commit comments

Comments
 (0)