Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kweinmeister committed Jan 25, 2023
1 parent 7d25c06 commit 23e2c74
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/storagetransfer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: storagetransfer
on:
push:
branches:
- main
paths:
- 'storagetransfer/**'
- '.github/workflows/storagetransfer.yaml'
pull_request:
paths:
- 'storagetransfer/**'
- '.github/workflows/storagetransfer.yaml'
pull_request_target:
types: [labeled]
paths:
- 'storagetransfer/**'
- '.github/workflows/storagetransfer.yaml'
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/[email protected]
with:
ref: ${{github.event.pull_request.head.sha}}
- 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'
access_token_lifetime: 600s
- id: secrets
uses: "google-github-actions/get-secretmanager-secrets@v1"
with:
secrets: |-
sts_aws_secret:cloud-devrel-kokoro-resources/nodejs-storagetransfer-azure
sts_azure_secret:cloud-devrel-kokoro-resources/nodejs-storagetransfer-azure
- uses: actions/[email protected]
with:
node-version: 16
- run: npm install
working-directory: storagetransfer
- run: npm test
working-directory: storagetransfer
env:
AWS_ACCESS_KEY_ID : ${{ fromJSON(steps.secrets.outputs.sts_aws_secret).AccessKeyId }}
AWS_SECRET_ACCESS_KEY: ${{ fromJSON(steps.secrets.outputs.sts_aws_secret).SecretAccessKey }}
AZURE_STORAGE_ACCOUNT: ${{ fromJSON(steps.secrets.outputs.sts_azure_secret).StorageAccount }}
AZURE_CONNECTION_STRING: ${{ fromJSON(steps.secrets.outputs.sts_azure_secret).ConnectionString }}
AZURE_SAS_TOKEN: ${{ fromJSON(steps.secrets.outputs.sts_azure_secret).SAS }}
MOCHA_REPORTER_SUITENAME: storagetransfer
MOCHA_REPORTER_OUTPUT: storagetransfer_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}}
1 change: 1 addition & 0 deletions .github/workflows/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"service-directory/snippets",
"secret-manager",
"speech",
"storagetransfer",
"talent",
"texttospeech",
"translate",
Expand Down
5 changes: 3 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ functions/memorystore @GoogleCloudPlatform/nodejs-samples-reviewers
functions/spanner @jsimonweb @GoogleCloudPlatform/nodejs-samples-reviewers

# SoDa teams
/cloud-sql/**/*.js @GoogleCloudPlatform/infra-db-dpes @GoogleCloudPlatform/nodejs-samples-reviewers
/datastore/**/*.js @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/nodejs-samples-reviewers
cloud-sql @GoogleCloudPlatform/infra-db-dpes @GoogleCloudPlatform/nodejs-samples-reviewers
datastore @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/nodejs-samples-reviewers
storagetransfer @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/nodejs-samples-reviewers

# One-offs
composer @leahecole @sofisl @GoogleCloudPlatform/nodejs-samples-reviewers
Expand Down

0 comments on commit 23e2c74

Please sign in to comment.