-
Notifications
You must be signed in to change notification settings - Fork 61
102 lines (88 loc) · 2.63 KB
/
test.yaml
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
93
94
95
96
97
98
99
100
101
102
name: pr-test
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.7'
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Checkout
uses: actions/checkout@master
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('REQUIREMENTS-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
run: pip install -r REQUIREMENTS-dev.txt
- name: Run flake8
run: flake8 --config setup.cfg
test:
runs-on: ubuntu-latest
needs:
- lint
defaults:
run:
working-directory: dockerize
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Generate the .env file
run: cp .env.template .env
- name: Run the containers
run: docker-compose up -d db devweb
- name: Wait for the containers to start
run: sleep 15
- name: Run Django tests
run: |
docker-compose exec -T devweb bash -c '
set -e # Exit immediately if any command fails
python manage.py makemigrations --merge --noinput &&
python manage.py makemigrations feedjack &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py test
'
- name: Start Django server
run: |
docker-compose exec -T devweb bash -c "python manage.py loaddata fixtures/*.json"
sleep 10
docker-compose exec -T devweb bash -c "nohup python manage.py runserver 0.0.0.0:8080 &"
- name: Test django endpoint
run: |
curl -v http://0.0.0.0:62202
if [ $? -ne 0 ]; then
echo "Curl command failed"
exit 1
fi
- name: Install playwright dependencies
working-directory: playwright/ci-test
run: |
npm install
npm ci
npx playwright install --with-deps
- name: Run Playwright tests
working-directory: playwright/ci-test
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright/ci-test/playwright-report/
retention-days: 30