Test env pass #8
This file contains 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: Go | |
on: [push] | |
jobs: | |
unit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.x' | |
cache-dependency-path: go.sum | |
- name: Install dependencies | |
run: go get . | |
- name: Build and test | |
run: | | |
go build -v ./... | |
go test ./... | |
e2e: | |
runs-on: ubuntu-latest | |
needs: unit | |
if: github.ref == 'refs/heads/main' | |
env: | |
MIGRATE_DST_INSTANCE: ${{ secrets.MIGRATE_DST_INSTANCE }} | |
MIGRATE_DST_PROJECT: ${{ secrets.MIGRATE_DST_PROJECT }} | |
MIGRATE_SRC_INSTANCE: ${{ secrets.MIGRATE_SRC_INSTANCE }} | |
MIGRATE_SRC_PROJECT: ${{ secrets.MIGRATE_SRC_PROJECT }} | |
WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
WORKLOAD_IDENTITY_SERVICE_ACCOUNT: ${{ secrets.WORKLOAD_IDENTITY_SERVICE_ACCOUNT }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.x' | |
cache-dependency-path: go.sum | |
- name: Install dependencies | |
run: go get . | |
- id: auth | |
name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ env.WORKLOAD_IDENTITY_SERVICE_ACCOUNT }} | |
create_credentials_file: true | |
- name: Build and test | |
run: | | |
go test -tags=e2e ./... |