diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..75ec9765 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +variables: + npm_config_cache: "$CI_PROJECT_DIR/.npm/" + CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress/" + +default: + image: + name: node:20-alpine + tags: + - docker + cache: + key: + files: + - package-lock.json + paths: + - node_modules/ + - $npm_config_cache + - $CYPRESS_CACHE_FOLDER + before_script: + - npm ci --prefer-offline + +stages: + - test + +test:unit: + stage: test + script: + - npm run test:unit + +test:e2e: + image: cypress/browsers:latest + stage: test + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - .next/cache/ + script: + - npm run build + - npm start & + - npm run test:e2e -- -b chrome diff --git a/README.md b/README.md index de7b60ec..fe79bc6e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ -[![tests](https://github.com/istex/istex-dl/actions/workflows/tests.yml/badge.svg)](https://github.com/istex/istex-dl/actions/workflows/tests.yml) - # istex-dl [Istex-DL](https://dl.istex.fr) is a web application dedicated to Istex sub-corpus extraction. It allows to download several [Istex](https://istex.fr) documents easily in an archive (zip or tar.gz) using a web interface. ## Disclaimer -**The version does not reflect what is currently running in production at [dl.istex.fr](https://dl.istex.fr)! We are currently rebuilding the application entirely, if you want to see the code running in production, checkout the [`master` branch](https://github.com/istex/istex-dl/tree/master).** +**This version does not reflect what is currently running in production at [dl.istex.fr](https://dl.istex.fr)! We are currently rebuilding the application entirely, if you want to see the code running in production, checkout the `master` branch.** ## Prerequisites