Skip to content

Commit

Permalink
ci: Update workflows for ai/ml/data to use labeled on pull_request tr…
Browse files Browse the repository at this point in the history
…igger (GoogleCloudPlatform#3753)

Co-authored-by: Jennifer Davis <sigje@google.com>
  • Loading branch information
grayside and iennae authored Jul 26, 2024
1 parent 917da65 commit 27102d2
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 63 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/ai-platform-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ on:
- 'ai-platform/snippets/**'
- '.github/workflows/ai-platform-snippets.yaml'
pull_request:
paths:
- 'ai-platform/snippets/**'
- '.github/workflows/ai-platform-snippets.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'ai-platform/snippets/**'
- '.github/workflows/ai-platform-snippets.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
Expand Down Expand Up @@ -67,8 +67,7 @@ jobs:
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: "${{ runner.os }}-node- \n"
- name: set env vars for scheduled run
if: github.event.action == 'schedule'
run: |
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/datacatalog-cloud-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/datacatalog-cloud-client.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'datacatalog/cloud-client/**'
- '.github/workflows/datacatalog-cloud-client.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'datacatalog/cloud-client/**'
- '.github/workflows/datacatalog-cloud-client.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/datacatalog-quickstart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/datacatalog-quickstart.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'datacatalog/quickstart/**'
- '.github/workflows/datacatalog-quickstart.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'datacatalog/quickstart/**'
- '.github/workflows/datacatalog-quickstart.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/datacatalog-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/datacatalog-snippets.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'datacatalog/snippets/**'
- '.github/workflows/datacatalog-snippets.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'datacatalog/snippets/**'
- '.github/workflows/datacatalog-snippets.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/datalabeling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/datalabeling.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'datalabeling/**'
- '.github/workflows/datalabeling.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'datalabeling/**'
- '.github/workflows/datalabeling.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/dataproc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/dataproc.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'dataproc/**'
- '.github/workflows/dataproc.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'dataproc/**'
- '.github/workflows/dataproc.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/dlp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ on:
- '.github/workflows/dlp.yaml'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'dlp/**'
- '.github/workflows/dlp.yaml'
- '.github/workflows/test.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'dlp/**'
- '.github/workflows/dlp.yaml'
- '.github/workflows/test.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
permissions:
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/generative-ai-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ on:
- 'generative-ai/snippets/**'
- '.github/workflows/generative-ai-snippets.yaml'
pull_request:
paths:
- 'generative-ai/snippets/**'
- '.github/workflows/generative-ai-snippets.yaml'
pull_request_target:
types: [labeled]
types:
- opened
- reopened
- synchronize
- labeled
paths:
- 'generative-ai/snippets/**'
- '.github/workflows/generative-ai-snippets.yaml'
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
Expand Down Expand Up @@ -59,20 +59,19 @@ jobs:
caip_id:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-caip-project-id
location:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-location
datastore_id:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-datastore-id
- uses: actions/setup-node@v4.0.0
- uses: actions/setup-node@v4.0.0
with:
node-version: 18
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
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-
restore-keys: "${{ runner.os }}-node- \n"
- name: install repo dependencies
run: npm install
working-directory: .
Expand All @@ -89,8 +88,8 @@ jobs:
env:
GOOGLE_SAMPLES_PROJECT: "long-door-651"
LOCATION: ${{ steps.secrets.outputs.location }}
CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }}
DATASTORE_ID: ${{ steps.secrets.outputs.datastore_id }}
CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }}
DATASTORE_ID: ${{ steps.secrets.outputs.datastore_id }}
- name: upload test results for FlakyBot workflow
if: github.event.action == 'schedule' && always()
uses: actions/upload-artifact@v3
Expand All @@ -99,7 +98,7 @@ jobs:
with:
name: test-results
path: generative-ai/snippets/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
retention-days: 1
flakybot:
permissions:
contents: 'read'
Expand Down

0 comments on commit 27102d2

Please sign in to comment.