-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (62 loc) · 1.63 KB
/
config.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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "21"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
node_modules
venv
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/requirements/ci.txt') }}
restore-keys: |
${{ runner.os }}-build-
- name: Install dependencies
run: |
npm install
python -m venv venv
source venv/bin/activate
pip install -r requirements/ci.txt
- name: Build frontend
run: npm run build
- name: Lint frontend
run: npm run lint
- name: Lint backend
run: |
source venv/bin/activate
cd phx
isort --check-only --quiet --recursive --diff phx
yapf --diff --recursive phx
flake8
- name: Test backend
run: |
source venv/bin/activate
cp .env.ci.example .env
cd phx && python manage.py test --settings=phx.settings.ci
services:
postgres:
image: postgres:13.8
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpw
POSTGRES_DB: testdb
ports:
- 5432:5432