Unnecessary installation in CI
Currently, the CI takes pretty long to execute the tests.
One reason is that all test steps, i.e., py36-functionnal
, py37-functionnal
, etc., update and install Docker.
image: python:3.10
script:
# Install docker programs (docker-cli, docker-compose)
- env
- apt update
- apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
- curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
- apt-key fingerprint 0EBFCD88
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
- apt update
- apt install -y docker-ce-cli docker-compose-plugin # Install sharelatex
- cd sharelatex/tests
- docker compose up -d
# Prepare the functional tests
# -create a user
# -export the env variables needed by the tests
- docker cp create-user-with-pass.js sharelatex:/var/www/sharelatex/web/modules/server-ce-scripts/scripts
As an alternative, I would propose to use images where the python version, docker, and docker compose are already installed. These images could be in the project's image registry or on a public registry as they are not confidential.
image: ghcr.io/pstoeckle/docker-images/docker-python-3.10:0.1.7
scripts:
- env
- cd sharelatex/tests
- docker compose up -d
# Prepare the functional tests
# -create a user
# -export the env variables needed by the tests
- docker cp create-user-with-pass.js sharelatex:/var/www/sharelatex/web/modules/server-ce-scripts/scripts
Edited by Patrick Stöckle