Skip to content
Snippets Groups Projects

Fix : CI avec lancement des tests unitaires

Merged Sarah Rubio requested to merge bugfix/CI into preprod
2 files
+ 31
20
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 28
20
stages:
- test
# Define the variables globally
variables:
POSTGRES_DB: anthology
POSTGRES_USER: anthology_django
@@ -11,30 +9,40 @@ variables:
APT_STATE_LISTS: "$CI_PROJECT_DIR/.apt/lists"
APT_CACHE_ARCHIVES: "$CI_PROJECT_DIR/.apt/archives"
cache:
- key:
files:
- uv.lock
paths:
- $UV_CACHE_DIR
- paths:
- .apt/
test:
stage: test
image: postgis/postgis:17-3.5
# Defining image, services and cache by default (defining globally is deprecated)
default:
image: ubuntu:latest
services:
- name: postgis/postgis:17-3.5
alias: postgres
before_script:
cache:
- key:
files:
- uv.lock
paths:
- $UV_CACHE_DIR
- paths:
- .apt/
# Defining the stages present in this pipeline
stages:
- build
# Running build stage
install_environment:
stage: build
script:
# Install dependencies and create associated cache dirs
- mkdir -p "${APT_STATE_LISTS}/partial"
- mkdir -p "${APT_CACHE_ARCHIVES}/partial"
- apt update -qy
- apt install -y apt-utils curl libgdal-dev make locales locales-all gettext sudo
- apt install -y apt-utils curl postgresql postgresql-contrib libgdal-dev make locales locales-all gettext sudo
- locale
- localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
- sudo locale-gen "en_US.UTF-8"
- sudo update-locale LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"
- sudo dpkg-reconfigure --frontend=noninteractive locales
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
- locale
- export PGPASSWORD=$POSTGRES_PASSWORD
- psql --username $POSTGRES_USER --host postgres -d $POSTGRES_DB -c "ALTER ROLE anthology_django SET client_encoding TO 'utf8';"
@@ -49,5 +57,5 @@ test:
- source $HOME/.local/bin/env
# Check the available version of Python
- uv python list
script:
- make compilemessages_ci
- make tests_ci
Loading