-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (73 loc) · 2.18 KB
/
test.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
name: Test
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['3.10', '3.11', '3.12']
env:
GCAMPUS_DB_USER: 'gcampus'
GCAMPUS_DB_NAME: 'gcampustest'
GCAMPUS_DB_PASSWORD: 'test-password'
GCAMPUS_DB_HOST: 'localhost'
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgis:
image: postgis/postgis:13-3.1
env:
POSTGRES_DB: ${{ env.GCAMPUS_DB_NAME }}
POSTGRES_USER: ${{ env.GCAMPUS_DB_USER }}
POSTGRES_PASSWORD: ${{ env.GCAMPUS_DB_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Install dependencies with apt
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends --no-install-suggests binutils libproj-dev gdal-bin libpango-1.0-0 libpangoft2-1.0-0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Node.js packages
run: npm ci --also=dev
- name: Build static files
run: npm run build
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Requirements
run: pip install -r requirements.txt
- name: Collect static files
run: python manage.py collectstatic --no-input
env:
DJANGO_SETTINGS_MODULE: 'gcampus.settings.test'
GCAMPUS_REDIS_HOST: 'localhost'
- name: Run Tests
run: python manage.py test
env:
DJANGO_SETTINGS_MODULE: 'gcampus.settings.test'
GCAMPUS_REDIS_HOST: 'localhost'