-
Notifications
You must be signed in to change notification settings - Fork 15
80 lines (65 loc) · 1.95 KB
/
backend_build.yml
File metadata and controls
80 lines (65 loc) · 1.95 KB
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
name: LMS Build
on:
push:
branches:
- dev
pull_request:
branches:
- dev
# on:
# schedule:
# - cron: '*/15 * * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo "MAILGUN_API_KEY=${{ secrets.MAILGUN_API_KEY }}" >> $GITHUB_ENV
echo "MAILGUN_SENDER_DOMAIN=${{ secrets.MAILGUN_SENDER_DOMAIN }}" >> $GITHUB_ENV
echo "FROM_EMAIL=${{ secrets.FROM_EMAIL }}" >> $GITHUB_ENV
- name: Install Python
uses: actions/setup-python@v4
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
cd backend
pip install poetry
poetry install
- name: Run the automated tests
run: |
cd backend
poetry run coverage run manage.py test
poetry run coverage report
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: |
cd frontend
yarn install
- name: Run Unit Tests
run: |
cd frontend
yarn test