Skip to content

Commit 4f3343e

Browse files
devin-ai-integration[bot]Joe Petrich
andcommitted
[ENG-xxx] Update CI workflow to skip integration tests for PRs
Co-Authored-By: Joe Petrich <[email protected]>
1 parent a200ba1 commit 4f3343e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ jobs:
2020
ref: ${{ github.head_ref }}
2121
fetch-depth: 0
2222

23+
# Only run Google Cloud authentication and integration tests for pushes to main
2324
- name: Authenticate to Google Cloud
24-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
25+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
2526
uses: google-github-actions/auth@v1
2627
with:
2728
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
2829
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
2930

3031
- name: Set up gcloud (for KMS client lib to auth)
31-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
32+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
3233
uses: google-github-actions/setup-gcloud@v1
3334
with:
3435
project_id: courtyard-frontend
@@ -52,7 +53,9 @@ jobs:
5253
- name: Run unit tests
5354
run: go test -v -timeout 120s ./... -short
5455

56+
# Only run integration tests for pushes to main
5557
- name: Run integration tests
58+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5659
env:
5760
GOOGLE_CLOUD_PROJECT: courtyard-frontend
5861
TEST_KMS_KEY_NAME: ${{ secrets.KMS_KEY_NAME }}

0 commit comments

Comments
 (0)