add test job

This commit is contained in:
Simon Larsen
2022-05-05 21:29:22 +01:00
parent efa27caf9a
commit 260b597961
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
name: Common Test
on:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
- 'staging-release'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
check-latest: true
- run: cd Common && npm install
- run: cd CommonServer && bash test-setup.sh
- run: cd CommonServer && npm install && npm run test

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Run database in docker-compose
cd ..
# Run Postgres
npm run-script start-enterprise-ci postgres

View File

@@ -46,6 +46,7 @@
"dev": "npm run start-enterprise-dev $npm_config_services",
"saas-dev": "export IS_SAAS_SERVICE=true && npm run dev $npm_config_services",
"start-enterprise-dev": "export DOCKER_CLIENT_TIMEOUT=1000 && export COMPOSE_HTTP_TIMEOUT=1000 && docker-compose -f docker-compose.dev.yml up -d $npm_config_services",
"start-enterprise-ci": "export DOCKER_CLIENT_TIMEOUT=1000 && export COMPOSE_HTTP_TIMEOUT=1000 && docker-compose -f docker-compose.ci.yml up -d $npm_config_services",
"stop-dev": "docker-compose -f docker-compose.dev.yml down --remove-orphans",
"staging-test": "cd tests && npm run-script staging-test",
"remove-all-containers": "docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) || echo 'No running containers'",