github: update CI with latest actions #55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
name: Python ${{ matrix.python-version }} / ${{ matrix.django }} | |
strategy: | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
django: | |
- django32 | |
- django42 | |
exclude: | |
- django: django32 | |
python-version: "3.11" | |
- django: django32 | |
python-version: "3.12" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade tox | |
- name: Setup test database | |
run: | | |
psql -c 'DROP DATABASE IF EXISTS metaset_test;' -U postgres -h localhost | |
psql -c 'CREATE DATABASE metaset_test;' -U postgres -h localhost | |
env: | |
PGPASSWORD: postgres | |
- name: Run tests | |
run: | | |
tox -v -e py-${{ matrix.django }} | |
env: | |
DB_HOST: localhost | |
DB_PORT: "5432" | |
DB_USER: postgres | |
DB_NAME: metaset_test | |
DB_PASSWORD: postgres |