Skip to content

Commit 7997894

Browse files
committed
add tests and CODEOWNERS update
1 parent ad0fec5 commit 7997894

File tree

4 files changed

+75
-0
lines changed

4 files changed

+75
-0
lines changed

.github/workflows/generate.js

100644100755
File mode changed.

.github/workflows/retail.yaml

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

CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ texttospeech @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-sample
7373
translate @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers
7474
video-intelligence @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers
7575
vision @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers
76+
77+
# Self-service
78+
retail @GoogleCloudPlatform/cloud-retail-team @GoogleCloudPlatform/nodejs-samples-reviewers

0 commit comments

Comments
 (0)