-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (59 loc) · 1.71 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
name: CI
on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
jobs:
backend:
runs-on: ubuntu-latest
services:
db:
image: postgres:latest
env:
POSTGRES_USER: ${{ secrets.DB_USERNAME }}
POSTGRES_PASSWORD: ${{ secrets.DB_USER_PASSWORD }}
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.0
- name: Setting .env
run: |
echo "${{ secrets.ENV }}" >> .env
cat .env
- name: Install dependencies
run: |
cd backend
pip install -r requirements.txt
- name: Run Django migrations
run: |
cd backend
python manage.py makemigrations --settings=nTeamProject.actions
python manage.py migrate --settings=nTeamProject.actions
- name: Run Django tests
run: |
cd backend
python manage.py test --settings=nTeamProject.actions
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache frontend packages
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-frontend-
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install packages
working-directory: frontend
run: npm install