Skip to content

Commit

Permalink
Update actions to latest versions (#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc authored Mar 11, 2024
1 parent c21ec4e commit ff90b73
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .github/actions/fabric-tests/action.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -34,31 +34,14 @@ jobs:
name: "Release new version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Validate input"
run: |
[[ "${{ github.event.inputs.changelog }}" != "true" ]] && { echo 'You didn''t update the changelog.' ; exit 1; }
[[ -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 "[email protected]"
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 }}
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ff90b73

Please sign in to comment.