-
Notifications
You must be signed in to change notification settings - Fork 3
180 lines (180 loc) · 7.58 KB
/
behat.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: (M) Behat Tests
on:
pull_request:
workflow_dispatch:
inputs:
database:
description: 'Recent database dump to use (leave blank to use artifact)'
sites:
description: 'Specify which sites to test or leave the default to run all tests.'
default: 'cci, champ, coco, usrse, careers, gpc, ky, nect'
required: true
prnum:
description: 'Pull request number — adds a comment to a pull request (nomally empty)'
permissions:
contents: write
actions: read
pull-requests: write
jobs:
cci:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'cci') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "cci"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
asp:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'asp')
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "asp"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
champ:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'champ') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "champ"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
coco:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'coco') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "coco"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
usrse:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'usrse') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "usrse"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
careers:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'careers') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "careers"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
gpc:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'gpc') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "gpc"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
ky:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'ky') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "ky"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
nect:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'nect') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "nect"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
wip:
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3
if: contains(github.event.inputs.sites, 'wip')
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "wip"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
# success:
# name: Actions to run on success
# needs: [cci, asp, champ, coco, usrse, careers, gpc, ky, nect, wip]
# if: ${{ success() || ( always() && ! cancelled() && ! failure() ) }}
# runs-on: ubuntu-latest
# steps:
# - name: Comment on pull request
# if: "${{ env.prnum != '' }}"
# run: |
# gh pr comment $prnum -R $REPO --body "🤖 -=-=-=- Behat Test was Successful -=-=-=- 🤖"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# prnum: ${{ github.event.inputs.prnum }}
# REPO: "${{ github.server_url }}/${{ github.repository }}"
# - name: Slack Notification Success
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_MESSAGE: 'success :rocket:'
# SLACK_TITLE: "Github action: behat success"
# SLACK_CHANNEL: behat-git-notifications
fail:
name: Actions to run on fail
needs: [cci, asp, champ, coco, usrse, careers, gpc, ky, nect, wip]
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
- name: Comment on pull request
if: "${{ env.prnum != '' }}"
run: |
gh pr comment $prnum -R $REPO --body "🤖 -=-=-=- Behat Test has failed 😩 -=-=-=- 🤖"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
prnum: ${{ github.event.inputs.prnum }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
- name: Slack Notification Fail
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: ':octagonal_sign: behat tests failed :octagonal_sign:'
SLACK_TITLE: "Github action: behat failure"
SLACK_CHANNEL: behat-git-notifications