Fix pipeline attempt (3): Fakeroot but with the correct docker image

This commit is contained in:
Kylian Schmidt
2025-09-08 15:12:30 +02:00
parent d9c5629127
commit 30389ccb92
+25 -8
View File
@@ -7,6 +7,7 @@ stages:
variables: variables:
CONTAINER_IMAGE: "gallery-generator.sif" CONTAINER_IMAGE: "gallery-generator.sif"
APPTAINER_CACHE_DIR: "$CI_PROJECT_DIR/.apptainer-cache"
# Cache to speed up builds # Cache to speed up builds
cache: cache:
@@ -17,11 +18,17 @@ cache:
# Build the Apptainer container # Build the Apptainer container
build:container: build:container:
stage: build 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: script:
- echo "Building Apptainer container..." - echo "Building Apptainer container..."
- singularity --version - apptainer --version
- singularity build --fakeroot $CONTAINER_IMAGE Singularity.def - apptainer build --fakeroot $CONTAINER_IMAGE Singularity.def
- ls -lh $CONTAINER_IMAGE - ls -lh $CONTAINER_IMAGE
artifacts: artifacts:
paths: paths:
@@ -31,25 +38,35 @@ build:container:
# Run tests inside the container # Run tests inside the container
test:pytest: test:pytest:
stage: test stage: test
image: quay.io/singularity/singularity:v3.8.7 image: ubuntu:22.04
dependencies: dependencies:
- build:container - 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: script:
- echo "Running pytest inside container..." - echo "Running pytest inside container..."
- singularity exec $CONTAINER_IMAGE pytest /src/tests/ -v - apptainer exec $CONTAINER_IMAGE pytest /src/tests/ -v
artifacts: artifacts:
when: always when: always
# Run tests with coverage # Run tests with coverage
test:coverage: test:coverage:
stage: test stage: test
image: quay.io/singularity/singularity:v3.8.7 image: ubuntu:22.04
dependencies: dependencies:
- build:container - 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: script:
- echo "Running coverage analysis inside container..." - echo "Running coverage analysis inside container..."
- singularity exec $CONTAINER_IMAGE pytest /src/tests/ --cov=/src --cov-report=xml --cov-report=term - apptainer 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 cat /src/coverage.xml > coverage.xml || echo "No coverage.xml found"
coverage: '/TOTAL.*\s+(\d+%)$/' coverage: '/TOTAL.*\s+(\d+%)$/'
artifacts: artifacts:
reports: reports: