Skip to content

Commit 74ff63e

Browse files
committed
Generate dataproc.yaml
1 parent e48e882 commit 74ff63e

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/dataproc.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: dataproc
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- 'dataproc/**'
8+
pull_request:
9+
paths:
10+
- 'dataproc/**'
11+
pull_request_target:
12+
types: [labeled]
13+
paths:
14+
- 'dataproc/**'
15+
schedule:
16+
- cron: '0 0 * * 0'
17+
jobs:
18+
test:
19+
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 60
22+
permissions:
23+
contents: 'write'
24+
pull-requests: 'write'
25+
id-token: 'write'
26+
steps:
27+
- uses: actions/[email protected]
28+
with:
29+
ref: ${{github.event.pull_request.head.sha}}
30+
- uses: 'google-github-actions/[email protected]'
31+
with:
32+
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
33+
service_account: '[email protected]'
34+
create_credentials_file: 'true'
35+
access_token_lifetime: 600s
36+
- uses: actions/[email protected]
37+
with:
38+
node-version: 16
39+
- run: npm install
40+
working-directory: dataproc
41+
- run: npm test
42+
working-directory: dataproc
43+
env:
44+
MOCHA_REPORTER_SUITENAME: dataproc
45+
MOCHA_REPORTER_OUTPUT: dataproc_sponge_log.xml
46+
MOCHA_REPORTER: xunit
47+
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
48+
uses: actions/github-script@v6
49+
with:
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
script: |
52+
try {
53+
await github.rest.issues.removeLabel({
54+
name: 'actions:force-run',
55+
owner: 'GoogleCloudPlatform',
56+
repo: 'nodejs-docs-samples',
57+
issue_number: context.payload.pull_request.number
58+
});
59+
} catch (e) {
60+
if (!e.message.includes('Label does not exist')) {
61+
throw e;
62+
}
63+
}
64+
- if: ${{ github.event_name == 'schedule'}}
65+
run: |
66+
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
67+
chmod +x ./flakybot
68+
./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

.github/workflows/workflows.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"datacatalog/cloud-client",
3131
"datacatalog/snippets",
3232
"datalabeling",
33+
"dataproc",
3334
"datastore/functions",
3435
"datacatalog/quickstart",
3536
"dialogflow",

0 commit comments

Comments
 (0)