Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/opencensus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: opencensus
on:
push:
branches:
- main
paths:
- 'opencensus/**'
pull_request:
paths:
- 'opencensus/**'
pull_request_target:
types: [labeled]
schedule:
- cron: '0 2 * * *'
jobs:
opencensus:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- 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
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm install
working-directory: opencensus
- run: npm test
working-directory: opencensus
env:
MOCHA_REPORTER_SUITENAME: opencensus
MOCHA_REPORTER_OUTPUT: opencensus_sponge_log.xml
MOCHA_REPORTER: xunit
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
uses: actions/github-script@v5
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'}}
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}}
13 changes: 0 additions & 13 deletions .kokoro/opencensus.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion opencensus/system-test/metrics-quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

'use strict';

const assert = require('assert');
const childProcess = require('child_process');
const assert = require('assert');

it('Should throw an error without projectId', async () => {
process.env.GOOGLE_PROJECT_ID = '';
Expand Down