Skip to content

Use PSRule for scanning #89

Use PSRule for scanning

Use PSRule for scanning #89

Workflow file for this run

name: Run Python E2E tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test_package:
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-13", "macos-latest-xlarge", "windows-latest"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest-xlarge
python_version: 3.8
- os: macos-latest-xlarge
python_version: 3.9
- os: macos-latest-xlarge
python_version: "3.10"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for MacOS Runner
if: matrix.os == 'macos-latest-xlarge'
run: brew install postgresql@14
- name: Setup postgres
uses: ikalnytskyi/action-setup-postgres@v6
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
playwright install chromium --with-deps
- name: Seed data
run: |
python3 src/manage.py migrate
python3 src/manage.py loaddata src/seed_data.json
env:
POSTGRES_HOST: localhost
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
- name: Run tests Windows
if: runner.os == 'windows'
run: python3 -m pytest --ignore=src/tests/local/test_gunicorn.py
env:
POSTGRES_HOST: localhost
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
- name: Run tests
if: runner.os != 'windows'
run: python3 -m pytest
env:
POSTGRES_HOST: localhost
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres