Skip to content

Commit

Permalink
ci(): migrate to circleci instead of travis
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Feb 11, 2020
1 parent 61df39c commit fd3e945
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 36 deletions.
82 changes: 82 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
version: 2

aliases:
- &restore-cache
restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- &install-deps
run:
name: Install dependencies
command: npm ci
- &build-packages
run:
name: Build
command: npm run build

jobs:
build:
working_directory: ~/nest
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: Update NPM version
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm ci
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: Build
command: npm run build

integration_tests:
working_directory: ~/nest
machine: true
steps:
- checkout
- run:
name: Prepare nvm
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run:
name: Upgrade Node.js
command: |
nvm install v12
node -v
nvm alias default v12
- run:
name: Install Docker Compose
command: |
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- *install-deps
- run:
name: Prepare
command: |
docker-compose up -d
sleep 10
- run:
name: List containers
command: docker ps
- run:
name: e2e tests
command: npm run test:integration

workflows:
version: 2
build-and-test:
jobs:
- build
- integration_tests:
requires:
- build

36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

File renamed without changes.

0 comments on commit fd3e945

Please sign in to comment.