Last active
December 15, 2020 06:42
-
-
Save jordanell/5205a62831ec74bf078a978edc776938 to your computer and use it in GitHub Desktop.
CircleCI config for Testing with Sequelize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
test: | |
docker: | |
- image: circleci/node:10.15.3 | |
- image: circleci/postgres:10.1 | |
steps: | |
# Init | |
- checkout | |
- restore_cache: | |
keys: | |
- v1-cache-{{ checksum "package.json" }} | |
- v1-cache- | |
- run: npm install | |
- save_cache: | |
paths: | |
- node_modules | |
key: v1-cache-{{ checksum "package.json" }} | |
# Test | |
- run: sudo apt-get update | |
- run: sudo apt install postgresql-client | |
- run: psql -U postgres -h localhost -p 5432 -c "CREATE USER my_user;" | |
- run: psql -U postgres -h localhost -p 5432 -c "ALTER USER my_user WITH SUPERUSER;" | |
- run: npm run db:create | |
- run: npm run db:migrate | |
- run: | |
name: Run unit tests | |
command: npm run test | |
environment: | |
NODE_ENV: test | |
workflows: | |
version: 2 | |
test: | |
jobs: | |
test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment