Skip to content

deps: Update Github Actions #2488

deps: Update Github Actions

deps: Update Github Actions #2488

Workflow file for this run

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: tests
on:
# Add labeled type to defaults
pull_request:
types: [opened, synchronize, reopened, labeled]
# Declare default permissions as read only.
permissions: read-all
jobs:
unit:
if: "${{ github.event.action != 'labeled' || github.event.label.name == 'tests: run' || github.event.label.name == 'tests: run-unit' }}"
name: unit tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.25"
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up build.env with phony secrets.
run: cp build.sample.env build.env
- name: make test
run: make test
e2e:
needs: unit
if: "${{ github.event.action == 'labeled' && github.event.label.name == 'tests: run' }}"
name: e2e tests
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13
with:
workload_identity_provider: ${{ vars.PROVIDER_NAME }}
service_account: ${{ vars.SERVICE_ACCOUNT }}
access_token_lifetime: 600s
- id: secrets
name: Get secrets
uses: google-github-actions/get-secretmanager-secrets@2b5f97c5a4b9c105e64646762ad4fc3f5128e6f5 # v2.2.5
with:
secrets: |-
NODEPOOL_SERVICEACCOUNT_EMAIL:${{ vars.GOOGLE_CLOUD_PROJECT }}/NODEPOOL_SERVICEACCOUNT_EMAIL
TFSTATE_STORAGE_BUCKET:${{ vars.GOOGLE_CLOUD_PROJECT }}/TFSTATE_STORAGE_BUCKET
WORKLOAD_ID_SERVICEACCOUNT_EMAIL:${{ vars.GOOGLE_CLOUD_PROJECT }}/WORKLOAD_ID_SERVICEACCOUNT_EMAIL
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2.2.1
- name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.25"
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- id: e2e
name: "Run E2E Tests"
run: "./tools/e2e_test_job.sh"
env:
ENVIRONMENT_NAME: "ci-pr"
NODEPOOL_SERVICEACCOUNT_EMAIL: "${{ steps.secrets.outputs.NODEPOOL_SERVICEACCOUNT_EMAIL }}"
WORKLOAD_ID_SERVICEACCOUNT_EMAIL: "${{ steps.secrets.outputs.WORKLOAD_ID_SERVICEACCOUNT_EMAIL }}"
TFSTATE_STORAGE_BUCKET: "${{ steps.secrets.outputs.TFSTATE_STORAGE_BUCKET }}"
E2E_PROJECT_ID: "${{vars.GOOGLE_CLOUD_PROJECT}}"