Skip to content

Commit 84db018

Browse files
committed
feat(*): add manual trigger for integration tests and limit auto-run to master branch PRs
1 parent c48bd46 commit 84db018

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name: CI Tests
33
on:
44
- pull_request
55
- push
6+
- workflow_dispatch:
7+
inputs:
8+
run_integration_tests:
9+
description: 'Run Cloud Build integration tests'
10+
required: false
11+
default: false
12+
type: boolean
613

714
env:
815
CI: true
@@ -66,3 +73,19 @@ jobs:
6673
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
6774
- run: npm ci
6875
- run: npm run test:bin
76+
cloud-build-integration:
77+
needs: "unit"
78+
runs-on: ubuntu-latest
79+
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false && github.event.pull_request.base.ref == 'master' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_integration_tests == 'true')
80+
steps:
81+
- uses: actions/checkout@v1
82+
- uses: google-github-actions/auth@v0
83+
with:
84+
credentials_json: "${{ secrets.CF3_INTEGRATION_TEST_GOOGLE_CREDENTIALS }}"
85+
create_credentials_file: true
86+
- name: "Run Cloud Build Integration Tests"
87+
run: |
88+
cd integration_test
89+
PROJECT_ID=cf3-integration-tests-v2-qa gcloud builds submit --config=cloudbuild-all.yaml --project=cf3-integration-tests-v2-qa
90+
env:
91+
PROJECT_ID: ${{ secrets.PROJECT_ID }}

0 commit comments

Comments
 (0)