From c2cd034a781523545c97d90b5e103a73fcc7a893 Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Fri, 19 Jul 2024 14:53:20 -0700 Subject: [PATCH] ci: update h-k workflows to used labeled on pull_requests --- .github/workflows/healthcare-consent.yaml | 13 ++-- .github/workflows/healthcare-datasets.yaml | 13 ++-- .github/workflows/healthcare-dicom.yaml | 13 ++-- .github/workflows/healthcare-fhir.yaml | 13 ++-- .github/workflows/healthcare-hl7v2.yaml | 13 ++-- .github/workflows/iam-deny.yaml | 81 +++++++++++----------- .github/workflows/kms.yaml | 13 ++-- 7 files changed, 76 insertions(+), 83 deletions(-) diff --git a/.github/workflows/healthcare-consent.yaml b/.github/workflows/healthcare-consent.yaml index 3115f38aba..572fc59233 100644 --- a/.github/workflows/healthcare-consent.yaml +++ b/.github/workflows/healthcare-consent.yaml @@ -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: diff --git a/.github/workflows/healthcare-datasets.yaml b/.github/workflows/healthcare-datasets.yaml index 04fd9a6571..12590ada06 100644 --- a/.github/workflows/healthcare-datasets.yaml +++ b/.github/workflows/healthcare-datasets.yaml @@ -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: diff --git a/.github/workflows/healthcare-dicom.yaml b/.github/workflows/healthcare-dicom.yaml index bed46d63ec..0d8b87dc86 100644 --- a/.github/workflows/healthcare-dicom.yaml +++ b/.github/workflows/healthcare-dicom.yaml @@ -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: diff --git a/.github/workflows/healthcare-fhir.yaml b/.github/workflows/healthcare-fhir.yaml index c03d9905b3..0d1421b689 100644 --- a/.github/workflows/healthcare-fhir.yaml +++ b/.github/workflows/healthcare-fhir.yaml @@ -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: diff --git a/.github/workflows/healthcare-hl7v2.yaml b/.github/workflows/healthcare-hl7v2.yaml index 9bf7bedbae..032844f16d 100644 --- a/.github/workflows/healthcare-hl7v2.yaml +++ b/.github/workflows/healthcare-hl7v2.yaml @@ -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: diff --git a/.github/workflows/iam-deny.yaml b/.github/workflows/iam-deny.yaml index de008a73f3..061d597872 100644 --- a/.github/workflows/iam-deny.yaml +++ b/.github/workflows/iam-deny.yaml @@ -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 @@ -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' diff --git a/.github/workflows/kms.yaml b/.github/workflows/kms.yaml index 07168d8f71..3de92fccb9 100644 --- a/.github/workflows/kms.yaml +++ b/.github/workflows/kms.yaml @@ -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: