-
Notifications
You must be signed in to change notification settings - Fork 13
134 lines (132 loc) · 5.04 KB
/
Copy pathcross_version_test.yml
File metadata and controls
134 lines (132 loc) · 5.04 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
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Cross-Version Tests and Upload
on:
schedule:
- cron: "0 0,19 * * *" # 12PM, 5PM Pacific; daily
- cron: "0 15 * * *" # 8AM Pacific; daily (separate trigger for uploading release candidate)
workflow_dispatch:
inputs:
batfish_repo:
description: "GitHub repo containing Batfish"
type: string
required: false
default: "batfish/batfish"
batfish_ref:
description: "Batfish ref to build a container from"
type: string
required: false
default: "master"
pybatfish_repo:
description: "GitHub repo containing Pybatfish"
type: string
required: false
default: "batfish/pybatfish"
pybatfish_ref:
description: "Pybatfish ref to build a wheel from"
type: string
required: false
default: "master"
jobs:
# Initial checks and build artifacts
precommit:
uses: ./.github/workflows/reusable-precommit.yml
with:
BATFISH_GITHUB_BATFISH_REPO: "${{ github.event.inputs.batfish_repo || 'batfish/batfish' }}"
BATFISH_GITHUB_BATFISH_REF: "${{ github.event.inputs.batfish_ref || 'master' }}"
BATFISH_GITHUB_PYBATFISH_REPO: "${{ github.event.inputs.pybatfish_repo || 'batfish/pybatfish' }}"
BATFISH_GITHUB_PYBATFISH_REF: "${{ github.event.inputs.pybatfish_ref || 'master' }}"
# Integration tests
test:
needs: precommit
uses: ./.github/workflows/reusable-integration-tests.yml
with:
bf_version: ${{ needs.precommit.outputs.bf_version }}
bf_test_artifact_age: "90"
bf_min_release_test_count: "2"
pybf_min_release_test_count: "2" # todo: bump to 3 once we have 3 releases with new API support
run_cross_version_tests: true
# Push public artifacts
upload:
needs:
- precommit
- test
uses: ./.github/workflows/reusable-upload.yml
with:
bf_version: ${{ needs.precommit.outputs.bf_version }}
# Consider manual builds or 8AM Pacific scheduled builds as a release candidate
queue_prod_release: ${{ github.event_name == 'workflow_dispatch' || github.event.schedule == '0 15 * * *' }}
test_tag: "test-${{ needs.precommit.outputs.bf_version }}"
release_tag: "${{ needs.precommit.outputs.bf_version }}"
BATFISH_GITHUB_BATFISH_REPO: "${{ needs.precommit.outputs.batfish_repo }}"
BATFISH_GITHUB_PYBATFISH_REPO: "${{ needs.precommit.outputs.pybatfish_repo }}"
BATFISH_GITHUB_PYBATFISH_REF: "${{ needs.precommit.outputs.pybatfish_resolved_sha }}"
secrets:
PYBATFISH_TEST_PYPI_TOKEN: ${{ secrets.PYBATFISH_TEST_PYPI_TOKEN }}
PYBATFISH_PYPI_TOKEN: ${{ secrets.PYBATFISH_PYPI_TOKEN }}
BATFISH_DOCKER_LOGIN_TOKEN: ${{ secrets.BATFISH_DOCKER_LOGIN_TOKEN }}
OPEN_SOURCE_BUILDKITEBOT_PUBLIC_REPO_TOKEN: ${{ secrets.OPEN_SOURCE_BUILDKITEBOT_PUBLIC_REPO_TOKEN }}
# Send Slack notification on failure for scheduled or post-merge jobs on master branch
notify_slack_on_failure:
needs:
- precommit
- test
- upload
if: |
always()
# failure() &&
# github.ref == 'refs/heads/master' &&
# (github.event_name == 'schedule' || github.event_name == 'push') &&
# !(github.event_name == 'workflow_dispatch' || github.event.schedule == '0 15 * * *')
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: slackapi/slack-github-action@v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "*Docker cross-version tests and upload workflow failed*",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Docker cross-version tests and upload workflow failed*"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Workflow:*\nDocker cross-version tests and upload"
},
{
"type": "mrkdwn",
"text": "*Status:*\nFailed"
},
{
"type": "mrkdwn",
"text": "*Trigger:*\n${{ github.event_name }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\nmaster"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Workflow Run in GitHub Actions"
},
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}