diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc3e11863879f96286869bba8d00768530ca6b0e..b724e32f4695baff22661c3d66095b648360aa6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ stages: - - server-test - - client-install - - client-test + - setup + - test include: - local: .gitlab/server.gitlab-ci.yml diff --git a/.gitlab/client.gitlab-ci.yml b/.gitlab/client.gitlab-ci.yml index 2881ef9d140d32fd0a3d07096f6a942b5a4f4742..f73fe0009fd41aad2f5aafacf62160657aa26bc9 100644 --- a/.gitlab/client.gitlab-ci.yml +++ b/.gitlab/client.gitlab-ci.yml @@ -1,31 +1,36 @@ -image: node:10 - -install: - stage: client-install +client:setup: + image: node:10 + stage: setup script: - cd client - npm install artifacts: name: "artifacts" untracked: true - expire_in: 60 mins + expire_in: 15 mins + paths: + - client/.npm/ + - client/node_modules/ + cache: + key: "$CI_COMMIT_REF_SLUG" paths: - client/.npm/ - client/node_modules/ -linting: - stage: client-test +client:linting: + image: node:10 + stage: test + needs: ["client:setup"] script: - cd client - npm run lint - dependencies: - - install -test:unit: - stage: client-test +client:test: + image: node:10 + stage: test + needs: ["client:setup"] script: - cd client - npm run test:coverage - dependencies: - - install + coverage: /All files\s*\|\s*([\d\.]+)/ diff --git a/.gitlab/server.gitlab-ci.yml b/.gitlab/server.gitlab-ci.yml index 33d3934c3ce1fa51ff12cccbb0384d70e28f91f8..e2913efbe4a840ec373a0bac452e2785141a900b 100644 --- a/.gitlab/server.gitlab-ci.yml +++ b/.gitlab/server.gitlab-ci.yml @@ -1,11 +1,15 @@ - - -test-server: +server:setup: image: python + stage: setup + artifacts: + paths: + - server/env + expire_in: 15 min + untracked: true cache: + key: "$CI_COMMIT_REF_SLUG" paths: - - server/env/ - stage: server-test + - server/env script: - python --version - pip install virtualenv @@ -13,4 +17,12 @@ test-server: - python -m venv env - source env/bin/activate - pip install -r requirements.txt + +server:test: + image: python + stage: test + needs: ["server:setup"] + script: + - cd server + - source env/bin/activate - pytest --cov app tests/