-
Notifications
You must be signed in to change notification settings - Fork 22
110 lines (108 loc) · 2.6 KB
/
pr.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
version: 2
defaults: &defaults
docker:
- image: canonicalwebteam/dev:v1.6.7
environment:
SECRET_KEY: local_development_fake_key
jobs:
test-site:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: yarn && pip3 install -r requirements.txt
- run:
name: Build the site resources
command: yarn run build
- run:
name: Run the site server
command: ./entrypoint 0.0.0.0:80
background: true
- run:
name: Check site is accessible
command: sleep 3 && curl --head --fail --retry-delay 5 --retry 10 --retry-connrefused http://localhost
linkchecker:
<<: *defaults
steps:
- checkout
- run:
name: Yarn install
command: yarn install
- run:
name: Yarn build
command: yarn build
- run:
name: Install dependencies
command: pip3 install -r requirements.txt
- run:
name: Start development server
command: ./entrypoint 0.0.0.0:80
background: true
- run:
name: Wait for development server
command: sleep 5
lint-python:
<<: *defaults
steps:
- checkout
- run:
name: Lint python code
command: yarn lint-python
lint-scss:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: yarn
- run:
name: Lint sass
command: yarn lint-scss
lint-js:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: yarn
- run:
name: Lint JS
command: yarn lint-js
test-python:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: yarn && pip3 install -r requirements.txt
- run:
name: Build the site resources
command: yarn run build
- run:
name: Install coverage
command: pip3 install coverage
- run:
name: Run tests with coverage
command: |
coverage run --source=. -m unittest discover tests
bash <(curl -s https://codecov.io/bash) -cF python
test-js:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: yarn
- run:
name: Run tests with jest
command: yarn run test-js
workflows:
version: 2
build:
jobs:
- test-site
- lint-scss
- lint-js
- lint-python
- test-python