-
Notifications
You must be signed in to change notification settings - Fork 26
120 lines (110 loc) · 3.52 KB
/
main.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
name: "OpenPrescribing CI"
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Retrieve Google Cloud credentials
run: ./.github/scripts/decrypt_secret.sh
env:
GOOGLE_CLOUD_GITHUB_ACTIONS_PASSPHRASE: ${{ secrets.GOOGLE_CLOUD_GITHUB_ACTIONS_PASSPHRASE }}
- name: Unit tests
run: docker compose run --service-ports test && docker compose run --service-ports test-production
env:
TEST_SUITE: nonfunctional
- name: Notify slack failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: tech-noise
status: "FAILURE (unit_test)"
color: danger
functional_tests:
runs-on: ubuntu-latest
strategy:
matrix:
browser: [ "Edge:latest:Windows:10", "Firefox:latest:OS X:Catalina" ]
steps:
- name: 'BrowserStack Env Setup'
uses: 'browserstack/github-actions/setup-env@master'
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
build-name: BUILD_INFO
project-name: REPO_NAME
- name: 'BrowserStack Local Tunnel Setup'
uses: 'browserstack/github-actions/setup-local@master'
with:
local-testing: start
local-identifier: random
local-logging-level: all-logs
- name: Checkout
uses: actions/checkout@v4
- name: Retrieve Google Cloud credentials
run: ./.github/scripts/decrypt_secret.sh
env:
GOOGLE_CLOUD_GITHUB_ACTIONS_PASSPHRASE: ${{ secrets.GOOGLE_CLOUD_GITHUB_ACTIONS_PASSPHRASE }}
- name: Functional tests
run: docker compose run --service-ports test
env:
TEST_SUITE: functional
BROWSER: ${{ matrix.browser }}
- name: 'BrowserStackLocal Stop'
uses: 'browserstack/github-actions/setup-local@master'
with:
local-testing: stop
- name: Notify slack failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
BROWSER: ${{ matrix.browser }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: tech-noise
status: "FAILURE (functional test $BROWSER)"
color: danger
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: "Linting"
run: |
pip install -r requirements.dev.txt
scripts/lint.sh
- name: Notify slack failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: tech-noise
status: "FAILURE (linting)"
color: danger
notify_slack:
runs-on: ubuntu-latest
needs: [ unit_test , functional_tests , linting ]
steps:
- name: Notify slack success
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: tech-noise
status: SUCCESS
color: good