Skip to content

Commit

Permalink
ci: add e2e tests pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Apr 5, 2023
1 parent 2cfc433 commit 68315c4
Showing 1 changed file with 46 additions and 10 deletions.
56 changes: 46 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ version: 2
aliases:
- &restore-cache
restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package.json" }}
- &install-deps
run:
name: Install dependencies
command: npm ci
name: Install dependencies
command: npm ci
- &build-packages
run:
name: Build
command: npm run build
name: Build
command: npm run build

jobs:
build:
working_directory: ~/nest
docker:
- image: cimg/node:17.9
- image: cimg/node:19.8
steps:
- checkout
- run:
name: Use NPM v8
command: npm install -g npm@^8
name: Update NPM version
command: sudo npm install -g npm@latest
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
Expand All @@ -34,11 +34,47 @@ jobs:
- ./node_modules
- run:
name: Build
command: npm run 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:e2e

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

- integration_tests:
requires:
- build

0 comments on commit 68315c4

Please sign in to comment.