-
Notifications
You must be signed in to change notification settings - Fork 87
111 lines (100 loc) · 3.7 KB
/
wf_test-integration.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
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
name: Integration
run-name: Integration tests ${{ github.event.client_payload.pull_request.number }}
on:
repository_dispatch:
types: [integration-command]
workflow_call:
# TODO: These inputs are not being used for now, we will change this when
# we start reacting to comments in the PR
inputs:
aws-region:
default: 'us-east-1'
required: false
type: string
azure-region:
default: 'East US 2'
required: false
type: string
azure-publisher-email:
default: noreply@booster.cloud
required: false
type: string
azure-publisher-name:
default: Booster App
required: false
type: string
secrets:
BOT_AWS_ACCESS_KEY_ID:
required: true
BOT_AWS_SECRET_ACCESS_KEY:
required: true
AZURE_CLIENTID:
required: true
AZURE_SECRET:
required: true
AZURE_TENANTID:
required: true
AZURE_SUBSCRIPTIONID:
required: true
AZURE_CREDENTIALS:
required: true
permissions:
pull-requests: write
id-token: write
jobs:
notify-start:
runs-on: ubuntu-latest
steps:
- name: Notify start of integration tests
if: github.event.client_payload.pull_request != null
uses: mshick/add-pr-comment@v2
with:
allow-repeats: true
issue: ${{ github.event.client_payload.pull_request.number }}
message: |
:hourglass: Integration tests are running...
Check their status [here](https://github.com/boostercloud/booster/actions/runs/${{ github.run_id }}) 👈
prepare-integration-tests:
uses: ./.github/workflows/re_test-integration-prepare.yml
with:
command_sha: ${{ github.event.client_payload.slash_command.args.named.sha }}
pr_sha: ${{ github.event.client_payload.pull_request.head.sha }}
pr_number: ${{ github.event.client_payload.pull_request.number }}
cli-integration-tests:
needs: prepare-integration-tests
uses: ./.github/workflows/re_test-integration-cli.yml
secrets: inherit
local-integration-tests:
needs: prepare-integration-tests
uses: ./.github/workflows/re_test-integration-local.yml
secrets: inherit
azure-integration-tests:
needs: prepare-integration-tests
uses: ./.github/workflows/re_test-integration-azure.yml
secrets: inherit
notify-end-success:
runs-on: ubuntu-latest
needs: [cli-integration-tests, local-integration-tests, azure-integration-tests]
if: ${{ always() && github.event.client_payload.pull_request != null && !contains(needs.*.result, 'failure') }}
steps:
- name: Notify success of integration tests
uses: mshick/add-pr-comment@v2
if: github.event.client_payload.pull_request != null
with:
allow-repeats: true
issue: ${{ github.event.client_payload.pull_request.number }}
message: |
:white_check_mark: Integration tests have [finished successfully](https://github.com/boostercloud/booster/actions/runs/${{ github.run_id }})!
notify-end-failure:
runs-on: ubuntu-latest
needs: [cli-integration-tests, local-integration-tests, azure-integration-tests]
if: ${{ always() && github.event.client_payload.pull_request != null && contains(needs.*.result, 'failure') }}
steps:
- name: Notify failure of integration tests
uses: mshick/add-pr-comment@v2
if: github.event.client_payload.pull_request != null
with:
allow-repeats: true
issue: ${{ github.event.client_payload.pull_request.number }}
message: |
:x: Oh no! Integration tests have [failed](https://github.com/boostercloud/booster/actions/runs/${{ github.run_id }})