-
Notifications
You must be signed in to change notification settings - Fork 12
121 lines (112 loc) · 4.22 KB
/
Copy pathnightly-contract-tests.yml
File metadata and controls
121 lines (112 loc) · 4.22 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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: Build Contract Test Service
shell: bash
run: make build-contract-tests -C lib/sdk/server
- name: Start Contract Test Service
shell: bash
run: make start-contract-test-service-bg -C lib/sdk/server
- name: Contract Tests (v2)
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
with:
test_service_port: '8000'
token: ${{ secrets.GITHUB_TOKEN }}
debug_logging: 'true'
stop_service: 'false'
enable_persistence_tests: 'false'
extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions.txt'
- name: Contract Tests v3 (with long-running tests)
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
with:
test_service_port: '8000'
version: 'v3.0.0-alpha.6'
branch: 'v3.0.0-alpha.6'
token: ${{ secrets.GITHUB_TOKEN }}
debug_logging: 'true'
enable_persistence_tests: 'false'
extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions-fdv2.txt -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 }}"
}
}
]
}