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: ...@@ -16,25 +16,35 @@ workflow:
# Pipeline start # 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 the fasta files if they have changed
validate-fasta-files: validate-fasta-files:
image: node:22-alpine
stage: validate stage: validate
rules: rules:
- changes: - changes:
- data/*.fasta - data/*.fasta
image: node:22-alpine
script: script:
- npm run validate - npm run validate
# Build the archive of the fasta files and compute the stats. # Build the archive of the fasta files and compute the stats.
# Commit the files in the data folder, triggering another CI. # Commit the files in the data folder, triggering another CI.
build-archive-and-stats: build-archive-and-stats:
image: node:22-alpine
stage: archive stage: archive
rules: rules:
- if: $CI_COMMIT_BRANCH == "master" - if: $CI_COMMIT_BRANCH == "master"
changes: changes:
- data/*.fasta - data/*.fasta
image: node:22-alpine
script: script:
- export CURRENT_DATE=$(date +'%Y-%m-%d') - export CURRENT_DATE=$(date +'%Y-%m-%d')
- export ARCHIVE_PATH=data/${CURRENT_DATE}.tar.gz - export ARCHIVE_PATH=data/${CURRENT_DATE}.tar.gz
...@@ -54,10 +64,10 @@ build-archive-and-stats: ...@@ -54,10 +64,10 @@ build-archive-and-stats:
# Build the docker image and store it the gitlab registery. # Build the docker image and store it the gitlab registery.
build-docker-image: build-docker-image:
image: docker:24
stage: build stage: build
rules: rules:
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev" - if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev"
image: docker:24
interruptible: true interruptible: true
script: script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
...@@ -68,10 +78,10 @@ build-docker-image: ...@@ -68,10 +78,10 @@ build-docker-image:
# Fetch the image of MongoDB from the DockerHub and store it if there is any changes. # 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. # This avoid issues with Docker in case of overpulling.
fetch-mongo-image: fetch-mongo-image:
image: docker:24
stage: build stage: build
rules: rules:
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev" - if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev"
image: docker:24
interruptible: true interruptible: true
script: script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
...@@ -81,8 +91,8 @@ fetch-mongo-image: ...@@ -81,8 +91,8 @@ fetch-mongo-image:
# Base stage for deploy-dev and deploy-prod # Base stage for deploy-dev and deploy-prod
.deploy: .deploy:
stage: deploy
image: registry-gitlab.pasteur.fr/dsi-tools/docker-images:docker_kubernetes_image image: registry-gitlab.pasteur.fr/dsi-tools/docker-images:docker_kubernetes_image
stage: deploy
interruptible: true interruptible: true
script: script:
- kubectl delete secret registry-gitlab -n ${NAMESPACE} --ignore-not-found=true - 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