Skip to content

Ajout de la configuration CI #4

Ajout de la configuration CI

Ajout de la configuration CI #4

Workflow file for this run

name: Django CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
tests:
environment: test
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.12]
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: gsl
POSTGRES_USER: gsl_team
POSTGRES_PASSWORD: gsl_pass
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DATABASE_HOST: ${{ vars.DATABASE_HOST }}
DATABASE_NAME: ${{ vars.DATABASE_NAME }}
DATABASE_USER: ${{ vars.DATABASE_USER }}
DATABASE_PASSWORD: ${{ vars.DATABASE_PASSWORD }}
DATABASE_PORT: ${{ vars.DATABASE_PORT }}
DATABASE_URL: "postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}"
steps:
- uses: actions/checkout@v4
- name: Check variables
run: |
echo "hello"
echo $DATABASE_NAME
echo $DATABASE_URL
echo $OTHER_VARIABLE
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Tests
run: |
python -m pytest