Bump robinraju/release-downloader from 1.9 to 1.11 #1296
Workflow file for this run
This file contains hidden or 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
| name: Sumaform validation | |
| on: | |
| pull_request: | |
| paths: | |
| - 'terracumber_config/tf_files/**/*.tf' | |
| - '.github/workflows/sumaform-validation.yml' | |
| - '!terracumber_config/tf_files/*build-validation*.tf' | |
| - '!terracumber_config/tf_files/PR-testing-template.tf' | |
| jobs: | |
| validate_sumaform: | |
| name: Validate sumaform files | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: tf_files | |
| name: Get modified .tf files | |
| uses: Ana06/[email protected] | |
| with: | |
| filter: '*.tf' | |
| # --- MISSING STEP RE-ADDED --- | |
| - name: Install terraform | |
| if: steps.tf_files.outputs.added_modified | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.6.0 | |
| terraform_wrapper: false # Required for script loops to work | |
| # ----------------------------- | |
| - name: Install opentofu | |
| if: steps.tf_files.outputs.added_modified | |
| uses: opentofu/[email protected] | |
| with: | |
| tofu_version: 1.10.7 | |
| - name: Checkout sumaform | |
| if: steps.tf_files.outputs.added_modified | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: uyuni-project/sumaform | |
| path: sumaform | |
| - name: Download Feilong terraform provider asset | |
| if: steps.tf_files.outputs.added_modified | |
| uses: robinraju/[email protected] | |
| with: | |
| repository: Bischoff/terraform-provider-feilong | |
| tag: 'v0.0.9' | |
| fileName: 'terraform-provider-feilong_0.0.9_linux_amd64.tar.gz' | |
| extract: true | |
| - name: Validate files | |
| if: steps.tf_files.outputs.added_modified | |
| env: | |
| TF_VAR_SCC_USER: "user" | |
| TF_VAR_SCC_PASSWORD: "password" | |
| TF_VAR_MIRROR: "" | |
| TF_VAR_PULL_REQUEST_REPO: "" | |
| TF_VAR_MASTER_REPO: "" | |
| TF_VAR_MASTER_OTHER_REPO: "" | |
| TF_VAR_MASTER_SUMAFORM_TOOLS_REPO: "" | |
| TF_VAR_UPDATE_REPO: "" | |
| TF_VAR_ADDITIONAL_REPO_URL: "" | |
| TF_VAR_TEST_PACKAGES_REPO: "" | |
| TF_VAR_SLE_CLIENT_REPO: "" | |
| TF_VAR_RHLIKE_CLIENT_REPO: "" | |
| TF_VAR_DEBLIKE_CLIENT_REPO: "" | |
| TF_VAR_OPENSUSE_CLIENT_REPO: "" | |
| TF_VAR_ZVM_ADMIN_TOKEN: "" | |
| TF_VAR_CONTAINER_REPOSITORY: "" | |
| TF_VAR_SERVER_CONTAINER_REPOSITORY: "" | |
| TF_VAR_PROXY_CONTAINER_REPOSITORY: "" | |
| TF_VAR_SERVER_CONTAINER_IMAGE: "" | |
| TF_VAR_ENVIRONMENT: "apprentice" | |
| run: | | |
| # Install feilong provider | |
| srcdir=/home/runner/work/susemanager-ci/susemanager-ci/ | |
| dstdir_terraform=/usr/share/terraform/plugins/registry.terraform.io/bischoff/feilong/0.0.4/linux_amd64/ | |
| dstdir_opentofu=/usr/share/terraform/plugins/registry.opentofu.org/bischoff/feilong/0.0.4/linux_amd64/ | |
| sudo mkdir -p $dstdir_terraform | |
| sudo mkdir -p $dstdir_opentofu | |
| sudo ln -s $srcdir/terraform-provider-feilong $dstdir_terraform | |
| sudo ln -s $srcdir/terraform-provider-feilong $dstdir_opentofu | |
| # Remove libvirt and feilong provider settings | |
| sed -i \ | |
| -e '/provider *"/,/^[ \/#]*\}\s*$/d' \ | |
| -e '/libvirt = {/,/^[ \/#]*\}\s*$/d' \ | |
| -e '/libvirt =/d' \ | |
| -e '/feilong = {/,/^[ \/#]*\}\s*$/d' \ | |
| -e '/feilong =/d' \ | |
| ${{steps.tf_files.outputs.added_modified}} | |
| # Also exclude s390 minions from terraform plan | |
| sed -i \ | |
| -e '/^module ".*s390.*" {$/,/^}$/d' \ | |
| -e '/.*s390.*_configuration *= module.*s390.*\.configuration/d' \ | |
| ${{steps.tf_files.outputs.added_modified}} | |
| # Setup sumaform with the 'null' backend | |
| cd sumaform | |
| ln -sfn ../backend_modules/null modules/backend | |
| # Provide a fake private SSH key | |
| mkdir -p ~/.ssh | |
| touch ~/.ssh/id_ed25519 | |
| # --- OpenTofu Validation Loop --- | |
| for tf_file in ${{steps.tf_files.outputs.added_modified}}; do | |
| if [[ "$tf_file" != "terracumber_config/tf_files/PR-testing-template.tf" ]]; then | |
| echo "::notice::[TOFU] Validating '`basename $tf_file`'..." | |
| rm -f main.tf variables.tf environment.tfvars | |
| cp ../$tf_file main.tf | |
| PLAN_ARGS="" | |
| SOURCE_DIR=$(dirname "../$tf_file") | |
| if [ -f "$SOURCE_DIR/variables.tf" ]; then | |
| cp "$SOURCE_DIR/variables.tf" variables.tf | |
| echo "::notice::Included variables.tf from $SOURCE_DIR" | |
| fi | |
| if [ -f "$SOURCE_DIR/environment.tfvars" ]; then | |
| cp "$SOURCE_DIR/environment.tfvars" environment.tfvars | |
| # echo SCC_PTF_USER="nothing" >> environment.tfvars | |
| # echo SCC_PTF_PASSWORD="nothing" >> environment.tfvars | |
| PLAN_ARGS="-var-file=environment.tfvars" | |
| echo "::notice::Included environment.tfvars from $SOURCE_DIR" | |
| fi | |
| # export TOFU_LOG=trace | |
| tofu init -input=false | |
| tofu validate | |
| tofu plan -input=false $PLAN_ARGS | |
| echo | |
| fi | |
| done | |
| # --- OpenTofu Validation Loop --- | |
| for tf_file in ${{steps.tf_files.outputs.added_modified}}; do | |
| if [[ "$tf_file" != "terracumber_config/tf_files/PR-testing-template.tf" ]]; then | |
| echo "::notice::[TERRAFORM] Validating '`basename $tf_file`'..." | |
| rm -f main.tf variables.tf environment.tfvars | |
| cp ../$tf_file main.tf | |
| SOURCE_DIR=$(dirname "../$tf_file") | |
| PLAN_ARGS="" | |
| if [ -f "$SOURCE_DIR/variables.tf" ]; then | |
| cp "$SOURCE_DIR/variables.tf" variables.tf | |
| echo "::notice::Included variables.tf from $SOURCE_DIR" | |
| fi | |
| if [ -f "$SOURCE_DIR/environment.tfvars" ]; then | |
| cp "$SOURCE_DIR/environment.tfvars" environment.tfvars | |
| PLAN_ARGS="-var-file=environment.tfvars" | |
| echo "::notice::Included environment.tfvars from $SOURCE_DIR" | |
| fi | |
| # export TF_LOG=trace | |
| terraform init -input=false | |
| terraform validate | |
| terraform plan -input=false $PLAN_ARGS | |
| echo | |
| fi | |
| done |