-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (62 loc) · 2.44 KB
/
daily-smoke-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
# 11:30AM CDT, meaning that any issues will be surfaced towards the start of business.
- cron: "30 17 * * *"
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