2024-02-16 14:20:35 -05:00
|
|
|
name: Test
|
2024-07-23 00:01:29 -04:00
|
|
|
on: [push, pull_request]
|
2024-02-16 14:20:35 -05:00
|
|
|
|
|
|
|
env:
|
2024-04-30 00:36:04 -04:00
|
|
|
DJANGO_CONFIGURATION: CI
|
2024-02-16 14:20:35 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: catthehacker/ubuntu:act-latest
|
|
|
|
services:
|
2024-08-26 23:45:39 -04:00
|
|
|
postgres:
|
2024-09-30 13:00:58 -04:00
|
|
|
image: postgres:17
|
2024-02-16 14:20:35 -05:00
|
|
|
env:
|
2024-08-26 23:45:39 -04:00
|
|
|
POSTGRES_PASSWORD: whatever
|
2024-02-16 14:20:35 -05:00
|
|
|
healthcheck:
|
2024-08-26 23:45:39 -04:00
|
|
|
test: ["CMD-SHELL", "pg_isready"]
|
2024-02-16 14:20:35 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PDM
|
|
|
|
uses: pdm-project/setup-pdm@v4
|
|
|
|
with:
|
|
|
|
cache: true
|
|
|
|
python-version: ~3.11
|
2024-02-17 13:47:27 -05:00
|
|
|
token: ""
|
2024-02-16 14:20:35 -05:00
|
|
|
- name: Install apt dependencies
|
|
|
|
run: >-
|
|
|
|
sudo apt-get update &&
|
2024-08-26 23:45:39 -04:00
|
|
|
sudo apt-get -y install build-essential python3-dev libldap2-dev libsasl2-dev
|
2024-02-16 14:20:35 -05:00
|
|
|
- name: Install python dependencies
|
2024-04-30 00:33:30 -04:00
|
|
|
run: pdm sync -d -G dev
|
2024-08-16 00:22:05 -04:00
|
|
|
|
|
|
|
- name: Setup pnpm
|
|
|
|
uses: pnpm/action-setup@v4
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
run_install: |
|
|
|
|
- args: [--frozen-lockfile, --strict-peer-dependencies]
|
|
|
|
- name: Build JS assets
|
|
|
|
run: pnpm run build
|
|
|
|
|
2024-02-16 14:20:35 -05:00
|
|
|
- name: Run tests
|
2024-04-18 11:43:02 -04:00
|
|
|
run: pdm run -v ./manage.py test
|