-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.53 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
name: Django Unit Tests
on: [push]
jobs:
test:
runs-on: ${{ matrix.os }}
environment: development
strategy:
max-parallel: 4
matrix:
os: ["macos-latest"] # ["macos-10.15", "ubuntu-latest", "windows-latest"]
python-version: ["3.10.5"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up miniconda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: testenv
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Conda status
shell: bash -l {0}
run: |
conda info
conda list
- name: Create .env file
shell: bash -l {0}
run: |
touch .env
echo SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> backend/.env
echo DEBUG=True >> backend/.env
echo ALLOWED_HOSTS="*" >> backend/.env
echo TIME_ZONE='Europe/Berlin' >> backend/.env
echo POSTGRES_DB='flask_db' >> backend/.env
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} >> backend/.env
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> backend/.env
echo POSTGRES_HOST='localhost' >> backend/.env
echo POSTGRES_PORT='5432' >> backend/.env
echo CORS_ALLOW_ALL_ORIGINS=True >> backend/.env
# - name: Set up (postgres) database
- name: Run django unit tests
shell: bash -l {0}
run: |
python3 backend/manage.py test