diff --git a/.github/workflows/production-heartbeat.yml b/.github/workflows/production-heartbeat-test.yml similarity index 57% rename from .github/workflows/production-heartbeat.yml rename to .github/workflows/production-heartbeat-test.yml index 3da27e7cd..40c0355dd 100644 --- a/.github/workflows/production-heartbeat.yml +++ b/.github/workflows/production-heartbeat-test.yml @@ -1,8 +1,9 @@ -name: production-heartbeat +name: production-heartbeat-test on: - schedule: - # Times are UTC - - cron: '45 1,5,9,13,17,21 * * *' + pull_request +# schedule: +# # Times are UTC +# - cron: '45 1,5,9,13,17,21 * * *' jobs: production-heartbeat: strategy: @@ -43,28 +44,26 @@ jobs: name: smoke-test-results-${{ runner.os }} path: smoke-test-results -# This part is commented out for now, so we can run the script for a day or two without risking blowing up PagerDuty. -# Once we've seen that it works properly, we'll re-enable the alerts. # === Report any failures === -# - name: Report failures -# if: ${{ failure() }} -# shell: bash -# env: -# # A link to this run -# RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} -# run: | -# curl --request POST \ -# --data '{"payload": { -# "summary": "Production heartbeat script failed on ${{ runner.os }}", -# "source": "Github Actions", -# "severity": "critical", -# "custom_details": "SFDX install: ${{ steps.sfdx_install.outcome }}. Scanner install: ${{ steps.scanner_install.outcome }}. Smoke tests: ${{ steps.smoke_tests.outcome }}" -# }, -# "links": [{ -# "href": "${{ env.RUN_LINK }}", -# "text": "Link to action execution" -# }], -# "event_action": "trigger", -# "routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}" -# }' \ -# https://events.pagerduty.com/v2/enqueue + - name: Report failures + if: ${{ failure() }} + shell: bash + env: + # A link to this run + RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + curl --request POST \ + --data '{"payload": { + "summary": "Production heartbeat script failed on ${{ runner.os }}", + "source": "Github Actions", + "severity": "critical", + "custom_details": "SFDX install: ${{ steps.sfdx_install.outcome }}. Scanner install: ${{ steps.scanner_install.outcome }}. Smoke tests: ${{ steps.smoke_tests.outcome }}" + }, + "links": [{ + "href": "${{ env.RUN_LINK }}", + "text": "Link to action execution" + }], + "event_action": "trigger", + "routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}" + }' \ + https://events.pagerduty.com/v2/enqueue diff --git a/smoke-tests/smoke-test.sh b/smoke-tests/smoke-test.sh index dc5325d84..c52199b0b 100755 --- a/smoke-tests/smoke-test.sh +++ b/smoke-tests/smoke-test.sh @@ -17,7 +17,7 @@ $EXE_NAME scanner:rule:describe -n EmptyCatchBlock echo "==== Describe a non-existent rule ====" $EXE_NAME scanner:rule:describe -n NotAnActualRule echo "==== Run rules against force-app, which should hit PMD and ESLint engines ====" -$EXE_NAME scanner:run --format junit --target test/code-fixtures/projects/app/force-app --outfile smoke-test-results/run1.xml +$EXE_NAME scanner:run --format foo --target test/code-fixtures/projects/app/force-app --outfile smoke-test-results/run1.xml echo "==== Run rules against a typescript file, which should run ESLint-Typescript ====" $EXE_NAME scanner:run --format junit --target test/code-fixtures/projects/ts/src/simpleYetWrong.ts --tsconfig test/code-fixtures/projects/tsconfig.json --outfile smoke-test-results/run2.xml echo "==== Run RetireJS against a folder ===="