-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (82 loc) · 2.7 KB
/
ci.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
name: CI
on:
push:
branches:
- main
- 'renovate/**'
pull_request:
jobs:
test_python:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: demo.settings
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- id: pip-cache
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-pip-v2-${{ hashFiles('**/runtime.txt') }}-${{ hashFiles('**/requirements.txt') }}
- if: steps.pip-cache.outputs.cache-hit != 'true'
run: python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
- run: source .venv/bin/activate && flake8 demo
- run: source .venv/bin/activate && black demo --check
- run: source .venv/bin/activate && python manage.py check
- run: source .venv/bin/activate && python manage.py render_patterns
test_node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- id: node-cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/.nvmrc') }}-${{ hashFiles('**/package-lock.json') }}
- if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci --no-audit
- run: npm run lint:js
- run: npm run lint:format
- run: npm run build
- uses: actions/upload-artifact@v3
with:
name: storybook_compiled
path: demo/storybook_compiled
retention-days: 1
test_storyshots:
runs-on: ubuntu-latest
needs: [test_python, test_node]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- id: node-cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/.nvmrc') }}-${{ hashFiles('**/package-lock.json') }}
- id: pip-cache
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-pip-v2-${{ hashFiles('**/runtime.txt') }}-${{ hashFiles('**/requirements.txt') }}
- uses: actions/download-artifact@v3
with:
name: storybook_compiled
path: demo/storybook_compiled
- run: source .venv/bin/activate && python manage.py runserver 0:8001 &
- run: npm run test
- uses: actions/upload-artifact@v3
with:
name: image_snapshots
path: demo/static_src/tests/__image_snapshots__
retention-days: 30