daily-smoke-test #474
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
name: daily-smoke-test | |
on: | |
workflow_dispatch: # As per documentation, the colon is needed even though no config is required. | |
schedule: | |
# Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value', and multiple values | |
# can be specified with comma-separated lists. All times are UTC. | |
# So this expression means "run at 17:30 UTC every day". This time was chosen because it corresponds to | |
# 9:30AM PST, meaning that any issues will be surfaced on working days when people are likely to be awake and online. | |
- cron: "30 17 * * 1-5" | |
jobs: | |
# Step 1: Build the scanner tarball so it can be installed locally. | |
build-scanner-tarball: | |
name: 'Build scanner tarball' | |
uses: ./.github/workflows/build-scanner-tarball.yml | |
with: | |
target-branch: 'dev-4' | |
# Step 2: Actually run the tests. | |
smoke-test: | |
name: 'Run smoke tests' | |
needs: build-scanner-tarball | |
uses: ./.github/workflows/run-tests.yml | |
with: | |
# For daily builds, we want to make sure we haven't pushed a breaking change | |
# to the scanner's `dev-4` branch. | |
use-scanner-tarball: true | |
# Step 3: Build a VSIX artifact for use if needed. | |
create-vsix-artifact: | |
name: 'Upload VSIX as artifact' | |
uses: ./.github/workflows/create-vsix-artifact.yml | |
# Step 4: Report any problems | |
report-problems: | |
name: 'Report problems' | |
runs-on: ubuntu-latest | |
needs: [build-scanner-tarball, smoke-test, create-vsix-artifact] | |
if: ${{ failure() || cancelled() }} | |
steps: | |
- name: Report problems | |
shell: bash | |
env: | |
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
run: | | |
ALERT_SEV="critical" | |
ALERT_SUMMARY="Daily smoke test failed on ${{ runner.os }}" | |
generate_post_data() { | |
cat <<EOF | |
{ | |
"payload": { | |
"summary": "${ALERT_SUMMARY}", | |
"source": "Github Actions", | |
"severity": "${ALERT_SEV}" | |
}, | |
"links": [{ | |
"href": "${{ env.RUN_LINK }}", | |
"text": "Link to action execution" | |
}], | |
"event_action": "trigger", | |
"dedup_key": "GH-HB-${{ matrix.os.vm }}-${{ matrix.node }}", | |
"routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}" | |
} | |
EOF | |
} | |
curl --request POST --data "$(generate_post_data)" https://events.pagerduty.com/v2/enqueue |