-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ace-n
committed
Nov 15, 2022
1 parent
3d61b14
commit b5fe1e6
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: automl | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'automl/**' | ||
pull_request: | ||
paths: | ||
- 'automl/**' | ||
pull_request_target: | ||
types: [labeled] | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
jobs: | ||
test: | ||
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
permissions: | ||
contents: 'write' | ||
pull-requests: 'write' | ||
id-token: 'write' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{github.event.pull_request.head.ref}} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
- uses: google-github-actions/[email protected] | ||
with: | ||
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider' | ||
service_account: '[email protected]' | ||
create_credentials_file: 'true' | ||
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | ||
access_token_lifetime: 600s | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
- run: npm install | ||
working-directory: automl | ||
- run: npm test | ||
working-directory: automl | ||
env: | ||
MOCHA_REPORTER_SUITENAME: automl | ||
MOCHA_REPORTER_OUTPUT: automl_sponge_log.xml | ||
MOCHA_REPORTER: xunit | ||
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }} | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
try { | ||
await github.rest.issues.removeLabel({ | ||
name: 'actions:force-run', | ||
owner: 'GoogleCloudPlatform', | ||
repo: 'nodejs-docs-samples', | ||
issue_number: context.payload.pull_request.number | ||
}); | ||
} catch (e) { | ||
if (!e.message.includes('Label does not exist')) { | ||
throw e; | ||
} | ||
} | ||
- if: ${{ github.event_name == 'schedule' && always() }} | ||
run: | | ||
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L | ||
chmod +x ./flakybot | ||
./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters