Skip to content

Commit b5fe1e6

Browse files
author
ace-n
committed
Add workflows config
1 parent 3d61b14 commit b5fe1e6

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/automl.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: automl
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- 'automl/**'
8+
pull_request:
9+
paths:
10+
- 'automl/**'
11+
pull_request_target:
12+
types: [labeled]
13+
schedule:
14+
- cron: '0 0 * * 0'
15+
jobs:
16+
test:
17+
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 60
20+
permissions:
21+
contents: 'write'
22+
pull-requests: 'write'
23+
id-token: 'write'
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
ref: ${{github.event.pull_request.head.ref}}
28+
repository: ${{github.event.pull_request.head.repo.full_name}}
29+
- uses: google-github-actions/[email protected]
30+
with:
31+
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
32+
service_account: '[email protected]'
33+
create_credentials_file: 'true'
34+
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
35+
access_token_lifetime: 600s
36+
- uses: actions/setup-node@v3
37+
with:
38+
node-version: 14
39+
- run: npm install
40+
working-directory: automl
41+
- run: npm test
42+
working-directory: automl
43+
env:
44+
MOCHA_REPORTER_SUITENAME: automl
45+
MOCHA_REPORTER_OUTPUT: automl_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' && always() }}
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
@@ -14,6 +14,7 @@
1414
"appengine/storage/flexible",
1515
"appengine/storage/standard",
1616
"auth",
17+
"automl",
1718
"appengine/typescript",
1819
"appengine/websockets",
1920
"appengine/twilio",

0 commit comments

Comments
 (0)