forked from dbca-wa/it-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 2.09 KB
/
run-tests.yml
File metadata and controls
66 lines (64 loc) · 2.09 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
name: 'Run Django unit tests'
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
workflow_dispatch:
jobs:
run_tests:
name: Run Django Tests
runs-on: ubuntu-latest
env:
DATABASE_URL: postgis://postgres:postgres@localhost:5432/postgres
ASCENDER_CREATE_AZURE_AD_LIMIT_DAYS: 14
services:
postgres:
image: postgis/postgis:15-3.4-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --mount type=tmpfs,destination=/var/lib/postgresql/data --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
#----------------------------------------------
# Checkout repo
#----------------------------------------------
- name: Checkout repo
uses: actions/checkout@v6
id: checkout-repo
with:
fetch-depth: 0
#----------------------------------------------
# Install GDAL into the environment
#----------------------------------------------
- name: Install GDAL
id: install-gdal
run: |
sudo apt-add-repository --yes ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install --no-install-recommends --yes gdal-bin libgdal-dev
#----------------------------------------------
# Install & configure uv
#----------------------------------------------
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: '3.13'
enable-cache: true
#----------------------------------------------
# Install project dependencies
#----------------------------------------------
- name: Install dependencies
run: uv sync
#----------------------------------------------
# Run unit tests
#----------------------------------------------
- name: Run tests
run: |
uv run python manage.py collectstatic
uv run python manage.py test --noinput --failfast --verbosity 0