-
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.
ci: update h-k workflows to used labeled on pull_requests
- Loading branch information
Showing
7 changed files
with
76 additions
and
83 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
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
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
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
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
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 |
---|---|---|
|
@@ -21,21 +21,21 @@ on: | |
- 'iam/deny/**' | ||
- '.github/workflows/iam-deny.yaml' | ||
pull_request: | ||
paths: | ||
- 'iam/deny/**' | ||
- '.github/workflows/iam-deny.yaml' | ||
pull_request_target: | ||
types: [labeled] | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- labeled | ||
paths: | ||
- 'iam/deny/**' | ||
- '.github/workflows/iam-deny.yaml' | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
- cron: '0 0 * * 0' | ||
jobs: | ||
test: | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
id-token: 'write' | ||
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 120 | ||
|
@@ -44,50 +44,49 @@ jobs: | |
working-directory: 'iam/deny' | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{github.event.pull_request.head.sha}} | ||
with: | ||
ref: ${{github.event.pull_request.head.sha}} | ||
- uses: 'google-github-actions/[email protected]' | ||
with: | ||
workload_identity_provider: 'projects/949737848314/locations/global/workloadIdentityPools/iam-deny-test-pool/providers/iam-deny-test-provider' | ||
service_account: '[email protected]' | ||
create_credentials_file: 'true' | ||
access_token_lifetime: 600s | ||
with: | ||
workload_identity_provider: 'projects/949737848314/locations/global/workloadIdentityPools/iam-deny-test-pool/providers/iam-deny-test-provider' | ||
service_account: '[email protected]' | ||
create_credentials_file: 'true' | ||
access_token_lifetime: 600s | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
with: | ||
node-version: 16 | ||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
shell: bash | ||
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
id: npm-cache-dir | ||
shell: bash | ||
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
- uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: "${{ runner.os }}-node- \n" | ||
- name: install repo dependencies | ||
run: npm install | ||
working-directory: . | ||
run: npm install | ||
working-directory: . | ||
- name: install directory dependencies | ||
run: npm install | ||
run: npm install | ||
- run: npm run build --if-present | ||
- name: set env vars for scheduled run | ||
if: github.event.action == 'schedule' | ||
run: | | ||
echo "MOCHA_REPORTER_SUITENAME=iam-deny" >> $GITHUB_ENV | ||
echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV | ||
echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV | ||
if: github.event.action == 'schedule' | ||
run: | | ||
echo "MOCHA_REPORTER_SUITENAME=iam-deny" >> $GITHUB_ENV | ||
echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV | ||
echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV | ||
- run: npm test | ||
- name: upload test results for FlakyBot workflow | ||
if: github.event.action == 'schedule' && always() | ||
uses: actions/upload-artifact@v3 | ||
env: | ||
MOCHA_REPORTER_OUTPUT: "${{github.run_id}}_sponge_log.xml" | ||
with: | ||
name: test-results | ||
path: iam/deny/${{ env.MOCHA_REPORTER_OUTPUT }} | ||
retention-days: 1 | ||
if: github.event.action == 'schedule' && always() | ||
uses: actions/upload-artifact@v3 | ||
env: | ||
MOCHA_REPORTER_OUTPUT: "${{github.run_id}}_sponge_log.xml" | ||
with: | ||
name: test-results | ||
path: iam/deny/${{ env.MOCHA_REPORTER_OUTPUT }} | ||
retention-days: 1 | ||
flakybot: | ||
permissions: | ||
contents: 'read' | ||
|
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