From 30389ccb92b5dd0fc96af062eb83389fda1c590f Mon Sep 17 00:00:00 2001 From: Kylian Schmidt Date: Mon, 8 Sep 2025 15:12:30 +0200 Subject: [PATCH] Fix pipeline attempt (3): Fakeroot but with the correct docker image --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ddc3b7..f24a3db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ stages: variables: CONTAINER_IMAGE: "gallery-generator.sif" + APPTAINER_CACHE_DIR: "$CI_PROJECT_DIR/.apptainer-cache" # Cache to speed up builds cache: @@ -17,11 +18,17 @@ cache: # Build the Apptainer container build:container: stage: build - image: quay.io/singularity/singularity:v3.8.7 + image: ubuntu:22.04 + before_script: + - apt-get update -qq + - apt-get install -y wget curl gpg + - wget -O /tmp/apptainer.deb https://github.com/apptainer/apptainer/releases/download/v1.2.5/apptainer_1.2.5_amd64.deb + - apt-get install -y /tmp/apptainer.deb + - mkdir -p $APPTAINER_CACHE_DIR script: - echo "Building Apptainer container..." - - singularity --version - - singularity build --fakeroot $CONTAINER_IMAGE Singularity.def + - apptainer --version + - apptainer build --fakeroot $CONTAINER_IMAGE Singularity.def - ls -lh $CONTAINER_IMAGE artifacts: paths: @@ -31,25 +38,35 @@ build:container: # Run tests inside the container test:pytest: stage: test - image: quay.io/singularity/singularity:v3.8.7 + image: ubuntu:22.04 dependencies: - build:container + before_script: + - apt-get update -qq + - apt-get install -y wget curl gpg + - wget -O /tmp/apptainer.deb https://github.com/apptainer/apptainer/releases/download/v1.2.5/apptainer_1.2.5_amd64.deb + - apt-get install -y /tmp/apptainer.deb script: - echo "Running pytest inside container..." - - singularity exec $CONTAINER_IMAGE pytest /src/tests/ -v + - apptainer exec $CONTAINER_IMAGE pytest /src/tests/ -v artifacts: when: always # Run tests with coverage test:coverage: stage: test - image: quay.io/singularity/singularity:v3.8.7 + image: ubuntu:22.04 dependencies: - build:container + before_script: + - apt-get update -qq + - apt-get install -y wget curl gpg + - wget -O /tmp/apptainer.deb https://github.com/apptainer/apptainer/releases/download/v1.2.5/apptainer_1.2.5_amd64.deb + - apt-get install -y /tmp/apptainer.deb script: - echo "Running coverage analysis inside container..." - - singularity exec $CONTAINER_IMAGE pytest /src/tests/ --cov=/src --cov-report=xml --cov-report=term - - singularity exec $CONTAINER_IMAGE cat /src/coverage.xml > coverage.xml || echo "No coverage.xml found" + - apptainer exec $CONTAINER_IMAGE pytest /src/tests/ --cov=/src --cov-report=xml --cov-report=term + - apptainer exec $CONTAINER_IMAGE cat /src/coverage.xml > coverage.xml || echo "No coverage.xml found" coverage: '/TOTAL.*\s+(\d+%)$/' artifacts: reports: