From ff90b736ca8229a44b126378c6539790acbc9040 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Mon, 11 Mar 2024 11:31:16 +0300 Subject: [PATCH] Update actions to latest versions (#2144) --- .github/actions/fabric-tests/action.yml | 10 +++++----- .github/workflows/daily-tag.yml | 2 +- .github/workflows/linting.yml | 8 ++++---- .github/workflows/release.yml | 21 ++------------------- .github/workflows/tests.yml | 21 +++++++++++---------- 5 files changed, 23 insertions(+), 39 deletions(-) diff --git a/.github/actions/fabric-tests/action.yml b/.github/actions/fabric-tests/action.yml index ea89b252da..aaf8290941 100644 --- a/.github/actions/fabric-tests/action.yml +++ b/.github/actions/fabric-tests/action.yml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,13 +28,13 @@ runs: echo '{"type": "service_account", "project_id": "test-only"}' \ | tee -a $GOOGLE_APPLICATION_CREDENTIALS - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'tests/requirements.txt' - name: Set up Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: terraform_version: ${{ inputs.TERRAFORM_VERSION }} terraform_wrapper: false @@ -47,12 +47,12 @@ runs: | tee -a /home/runner/.terraformrc mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - name: Download lockfile - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: lockfile path: tools/lockfile - name: Download Terraform provider cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.TF_PLUGIN_CACHE_DIR }} key: ${{ runner.os }}-terraform-${{ hashFiles('tools/lockfile/.terraform.lock.hcl') }} diff --git a/.github/workflows/daily-tag.yml b/.github/workflows/daily-tag.yml index 7ae775a37b..6a95e649cc 100644 --- a/.github/workflows/daily-tag.yml +++ b/.github/workflows/daily-tag.yml @@ -28,7 +28,7 @@ jobs: name: "Create tag on master if there was activity in last 24 hours" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Check changes and tag" run: | diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 939f76a9ec..e297471abd 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,17 +22,17 @@ jobs: linting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" cache: 'pip' cache-dependency-path: 'tools/requirements.txt' - name: Set up Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: terraform_version: 1.7.4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55e3f58e6e..b4e30d9633 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ jobs: name: "Release new version" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Validate input" run: | @@ -42,23 +42,6 @@ jobs: [[ -n "${{ github.event.inputs.version }}" ]] || { echo 'Version not specified!'; exit 1; } [[ "${{ github.event.inputs.version }}" != v* ]] && { echo 'Version does not start with v!' ; exit 1; } - - uses: actions/setup-go@v3 - with: - go-version: "1.16" - - - name: "Update all module names" - run: | - cd tools/tfeditor - go build . - ./tfeditor -path ../.. -module-name "google-pso-tool/cloud-foundation-fabric/{{ .Module }}/${{ github.event.inputs.version }}" - cd ../.. - - git config --global user.name "Release Automation" - git config --global user.email "cloud-foundation-fabric@google.com" - - git commit -a -m "Release version ${{ github.event.inputs.version }}" - git push origin master - - name: "Tag and release" run: | git tag ${{ github.event.inputs.version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8adef331ca..c7c101072a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,9 +32,9 @@ jobs: setup-tf-providers: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: hashicorp/setup-terraform@v2 + - uses: hashicorp/setup-terraform@v3 with: terraform_version: ${{ env.TF_VERSION }} terraform_wrapper: false @@ -51,23 +51,24 @@ jobs: terraform init -upgrade=true - name: Upload Terraform provider cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.TF_PLUGIN_CACHE_DIR }} key: ${{ runner.os }}-terraform-${{ hashFiles('tools/lockfile/.terraform.lock.hcl') }} - name: Upload lockfile - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: lockfile path: tools/lockfile/.terraform.lock.hcl + overwrite: true examples-blueprints: runs-on: ubuntu-latest needs: setup-tf-providers steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Call composite action fabric-tests uses: ./.github/actions/fabric-tests @@ -82,7 +83,7 @@ jobs: runs-on: ubuntu-latest needs: setup-tf-providers steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Call composite action fabric-tests uses: ./.github/actions/fabric-tests @@ -97,7 +98,7 @@ jobs: runs-on: ubuntu-latest needs: setup-tf-providers steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Call composite action fabric-tests uses: ./.github/actions/fabric-tests @@ -112,7 +113,7 @@ jobs: runs-on: ubuntu-latest needs: setup-tf-providers steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Call composite action fabric-tests uses: ./.github/actions/fabric-tests @@ -127,7 +128,7 @@ jobs: runs-on: ubuntu-latest needs: setup-tf-providers steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Call composite action fabric-tests uses: ./.github/actions/fabric-tests