diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..324be6ef0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +run_tests: + stage: test + image: cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4 + services: + - name: mysql:8.0 + alias: mysql + variables: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: box + BOX_ENV: ci + DATABASE_URL: mysql://root:password@mysql/box + script: + - echo "Running tests..." + - mysql -hmysql -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';" + - mysql -hmysql -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS box" + - npm install + - node_modules/.bin/db-migrate up + - ln -s /usr/local/node-18.18.0/bin/node /usr/bin/node + - node_modules/.bin/mocha --no-timeouts --bail src/test/tokens-test.js + - echo "Done!" + +stages: + - test + diff --git a/src/test/check-install b/src/test/check-install index 1345718f0..cfe672520 100755 --- a/src/test/check-install +++ b/src/test/check-install @@ -6,7 +6,7 @@ readonly source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" readonly sudo_scripts_dir="${source_dir}/src/scripts" if [[ ! -f /usr/bin/node ]]; then - echo "node is not in root user's environment. '/usr/bin/env node' will not work" + echo "check-install: node is not in root user's environment. '/usr/bin/env node' will not work" exit 1 fi