-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (93 loc) · 3.35 KB
/
nightly-contract-tests.yml
File metadata and controls
99 lines (93 loc) · 3.35 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Nightly Contract Tests
on:
schedule:
- cron: "0 4 * * *" # every day at 4am UTC
workflow_dispatch:
inputs:
branch:
description: 'Branch to run contract tests on'
required: false
default: ''
test_slack_notification:
description: 'Also send a test Slack notification (to verify Slack integration)'
required: false
type: boolean
default: false
jobs:
nightly-contract-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch || github.ref }}
- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/sdk/server'
java_version: 8
- name: Contract Tests (with long-running tests)
uses: ./.github/actions/contract-tests
with:
workspace_path: 'lib/sdk/server'
token: ${{ secrets.GITHUB_TOKEN }}
test_harness_params_v3: '-enable-long-running-tests'
notify-slack-on-failure:
runs-on: ubuntu-latest
if: ${{ always() && needs.nightly-contract-tests.result == 'failure' }}
needs:
- nightly-contract-tests
steps:
- name: Send Slack notification
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":warning: *Nightly Contract Tests Failed* :warning:\nThe nightly contract tests (with long-running tests enabled) failed on `${{ github.ref_name }}`."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "View failed run"
},
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
test-slack-notification:
runs-on: ubuntu-latest
if: ${{ inputs.test_slack_notification == true || inputs.test_slack_notification == 'true' }}
steps:
- name: Send test Slack notification
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":white_check_mark: *Nightly Contract Tests – Slack test*\nThis is a test notification to verify Slack integration is working. Triggered manually from the Nightly Contract Tests workflow."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "View workflow run"
},
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}