-
-
Notifications
You must be signed in to change notification settings - Fork 156
92 lines (80 loc) · 2.77 KB
/
run_tests.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
85
86
87
88
89
90
91
92
name: Backend Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10", "3.11", "3.12" ]
django-version: [ 4, 5 ]
runs-on: ${{ matrix.os }}
env:
DOCKER_COMPOSE_PATH: ./infrastructure/backend/docker-compose.ci.yml
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# install and configure poetry
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.0
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: true
#----------------------------------------------
# copy docker compose file
#----------------------------------------------
- name: Copy docker compose file
run: |
cp $GITHUB_WORKSPACE/$DOCKER_COMPOSE_PATH ./docker-compose.yml
#----------------------------------------------
# build Frontend files
#----------------------------------------------
- name: Install dependencies and build frontend
run: |
npm ci
npm run tailwind-build
npm run webpack-build
if [ -f frontend/static/src/output.css ]; then
echo "output.css is created"
else
echo "output.css is not created"
exit 1
fi
if [ -d frontend/static/js/c/ ]; then
echo "webpack has been built"
else
echo "frontend/static/js/c/ was not created from webpack build"
exit 1
fi
if [ -f webpack-stats.json ]; then
echo "webpack has built webpack-stats to work with chunks"
else
echo "webpack-stats was not built so cannot work with chunks"
exit 1
fi
#----------------------------------------------
# run docker compose & tests
#----------------------------------------------
- name: Build and run docker-compose.ci.yml
run: |
export TESTING=true
docker compose up -d --wait --wait-timeout 30
- name: Run the test scripts
run: |
export TESTING=true
docker compose exec -T myfinances_django ./infrastructure/backend/scripts/tests/views.sh