Skip to content

Commit

Permalink
ci: update h-k workflows to used labeled on pull_requests (GoogleClou…
Browse files Browse the repository at this point in the history
  • Loading branch information
grayside authored Jul 22, 2024
1 parent ca18657 commit c9b6c1e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 83 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/healthcare-consent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/healthcare-consent.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'healthcare/consent/**'
- '.github/workflows/healthcare-consent.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'healthcare/consent/**'
- '.github/workflows/healthcare-consent.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/healthcare-datasets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/healthcare-datasets.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'healthcare/datasets/**'
- '.github/workflows/healthcare-datasets.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'healthcare/datasets/**'
- '.github/workflows/healthcare-datasets.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/healthcare-dicom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/healthcare-dicom.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'healthcare/dicom/**'
- '.github/workflows/healthcare-dicom.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'healthcare/dicom/**'
- '.github/workflows/healthcare-dicom.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/healthcare-fhir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/healthcare-fhir.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'healthcare/fhir/**'
- '.github/workflows/healthcare-fhir.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'healthcare/fhir/**'
- '.github/workflows/healthcare-fhir.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/healthcare-hl7v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/healthcare-hl7v2.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'healthcare/hl7v2/**'
- '.github/workflows/healthcare-hl7v2.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'healthcare/hl7v2/**'
- '.github/workflows/healthcare-hl7v2.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down
81 changes: 40 additions & 41 deletions .github/workflows/iam-deny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ on:
- 'iam/deny/**'
- '.github/workflows/iam-deny.yaml'
pull_request:
paths:
- 'iam/deny/**'
- '.github/workflows/iam-deny.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'iam/deny/**'
- '.github/workflows/iam-deny.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
contents: 'read'
id-token: 'write'
id-token: 'write'
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
Expand All @@ -44,50 +44,49 @@ jobs:
working-directory: 'iam/deny'
steps:
- uses: actions/checkout@v4.1.0
with:
ref: ${{github.event.pull_request.head.sha}}
with:
ref: ${{github.event.pull_request.head.sha}}
- uses: 'google-github-actions/auth@v1.1.1'
with:
workload_identity_provider: 'projects/949737848314/locations/global/workloadIdentityPools/iam-deny-test-pool/providers/iam-deny-test-provider'
service_account: 'kokoro-ca@isakovf-iam-deny-samples.iam.gserviceaccount.com'
create_credentials_file: 'true'
access_token_lifetime: 600s
with:
workload_identity_provider: 'projects/949737848314/locations/global/workloadIdentityPools/iam-deny-test-pool/providers/iam-deny-test-provider'
service_account: 'kokoro-ca@isakovf-iam-deny-samples.iam.gserviceaccount.com'
create_credentials_file: 'true'
access_token_lifetime: 600s
- uses: actions/setup-node@v4.0.0
with:
node-version: 16
with:
node-version: 16
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: "${{ runner.os }}-node- \n"
- name: install repo dependencies
run: npm install
working-directory: .
run: npm install
working-directory: .
- name: install directory dependencies
run: npm install
run: npm install
- run: npm run build --if-present
- name: set env vars for scheduled run
if: github.event.action == 'schedule'
run: |
echo "MOCHA_REPORTER_SUITENAME=iam-deny" >> $GITHUB_ENV
echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV
echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV
if: github.event.action == 'schedule'
run: |
echo "MOCHA_REPORTER_SUITENAME=iam-deny" >> $GITHUB_ENV
echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV
echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV
- run: npm test
- name: upload test results for FlakyBot workflow
if: github.event.action == 'schedule' && always()
uses: actions/upload-artifact@v3
env:
MOCHA_REPORTER_OUTPUT: "${{github.run_id}}_sponge_log.xml"
with:
name: test-results
path: iam/deny/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
if: github.event.action == 'schedule' && always()
uses: actions/upload-artifact@v3
env:
MOCHA_REPORTER_OUTPUT: "${{github.run_id}}_sponge_log.xml"
with:
name: test-results
path: iam/deny/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
flakybot:
permissions:
contents: 'read'
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/kms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/kms.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'kms/**'
- '.github/workflows/kms.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'kms/**'
- '.github/workflows/kms.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down

0 comments on commit c9b6c1e

Please sign in to comment.