|
|
|
@ -1,12 +1,13 @@
|
|
|
|
|
# .semaphore/semaphore.yml
|
|
|
|
|
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
# Use the latest stable version of Semaphore 2.0 YML syntax:
|
|
|
|
|
version: v1.0
|
|
|
|
|
|
|
|
|
|
# Name your pipeline. In the event that you connect multiple pipelines with promotions,
|
|
|
|
|
# the name will help you differentiate between, for example, CI build phases
|
|
|
|
|
# and delivery phases.
|
|
|
|
|
name: MovieFinderPiepline
|
|
|
|
|
name: MovieFinder Pipeline
|
|
|
|
|
|
|
|
|
|
# An agent defines the environment in which your code runs.
|
|
|
|
|
# It is a combination of one of available machine types and operating
|
|
|
|
@ -124,3 +125,38 @@ blocks:
|
|
|
|
|
- cache restore server-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),server-node-modules-$SEMAPHORE_GIT_BRANCH,server-node-modules-master
|
|
|
|
|
- npm test
|
|
|
|
|
|
|
|
|
|
- name: E2e Tests
|
|
|
|
|
task:
|
|
|
|
|
env_vars:
|
|
|
|
|
- name: NODE_ENV
|
|
|
|
|
value: test
|
|
|
|
|
- name: CI
|
|
|
|
|
value: 'true'
|
|
|
|
|
prologue:
|
|
|
|
|
commands:
|
|
|
|
|
- checkout
|
|
|
|
|
- nvm use
|
|
|
|
|
- node --version
|
|
|
|
|
- npm --version
|
|
|
|
|
# Start a Postgres database. On Semaphore, databases run in the same
|
|
|
|
|
# environment as your code.
|
|
|
|
|
# See https://docs.semaphoreci.com/ci-cd-environment/ubuntu-18.04-image/#databases-and-services
|
|
|
|
|
- sem-service start postgres
|
|
|
|
|
# With unrestricted sudo access, you can install any additional
|
|
|
|
|
# system package:
|
|
|
|
|
- sudo apt-get install -y libgtk2.0-0
|
|
|
|
|
jobs:
|
|
|
|
|
- name: Client Tests
|
|
|
|
|
commands:
|
|
|
|
|
- cd src/client
|
|
|
|
|
- cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
|
|
|
|
|
- npx cypress install
|
|
|
|
|
- npm run test:e2e
|
|
|
|
|
- name: Server Tests
|
|
|
|
|
commands:
|
|
|
|
|
- cd src/server
|
|
|
|
|
- cache restore server-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),server-node-modules-$SEMAPHORE_GIT_BRANCH,server-node-modules-master
|
|
|
|
|
- cp ci.env .env
|
|
|
|
|
- cp ormconfig.ci.json ormconfig.json
|
|
|
|
|
- npm run migrate:up
|
|
|
|
|
- npm run test:e2e
|