Skip to content
Snippets Groups Projects
Commit be11af6e authored by Simon Malesys's avatar Simon Malesys
Browse files

Add the tests to the CI

parent 3046c9f3
No related branches found
No related tags found
No related merge requests found
Pipeline #149754 passed
......@@ -16,25 +16,35 @@ workflow:
# Pipeline start
# =============================================================================
# Run the unit tests
testing:
image: node:22-alpine
stage: validate
rules:
- changes:
- src/**/*
script:
- npm test
# Validate the fasta files if they have changed
validate-fasta-files:
image: node:22-alpine
stage: validate
rules:
- changes:
- data/*.fasta
image: node:22-alpine
script:
- npm run validate
# Build the archive of the fasta files and compute the stats.
# Commit the files in the data folder, triggering another CI.
build-archive-and-stats:
image: node:22-alpine
stage: archive
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- data/*.fasta
image: node:22-alpine
script:
- export CURRENT_DATE=$(date +'%Y-%m-%d')
- export ARCHIVE_PATH=data/${CURRENT_DATE}.tar.gz
......@@ -54,10 +64,10 @@ build-archive-and-stats:
# Build the docker image and store it the gitlab registery.
build-docker-image:
image: docker:24
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev"
image: docker:24
interruptible: true
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
......@@ -68,10 +78,10 @@ build-docker-image:
# Fetch the image of MongoDB from the DockerHub and store it if there is any changes.
# This avoid issues with Docker in case of overpulling.
fetch-mongo-image:
image: docker:24
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev"
image: docker:24
interruptible: true
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
......@@ -81,8 +91,8 @@ fetch-mongo-image:
# Base stage for deploy-dev and deploy-prod
.deploy:
stage: deploy
image: registry-gitlab.pasteur.fr/dsi-tools/docker-images:docker_kubernetes_image
stage: deploy
interruptible: true
script:
- kubectl delete secret registry-gitlab -n ${NAMESPACE} --ignore-not-found=true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment