Skip to content

Commit

Permalink
change:ci.yml and add test:ci to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
zuies committed May 10, 2023
1 parent 0c2f628 commit 837526e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: tc-discordBot

on: [push, pull_request]
on:
push:
pull_request:

jobs:
test:
Expand All @@ -16,7 +18,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
NODE_ENV: 'test'
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USER: ${{ secrets.DB_USER }}
Expand All @@ -27,8 +29,14 @@ jobs:
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ENV: ${{ secrets.SENTRY_ENV }}
- name: Create mongoDB Docker container
run: sudo docker run -d -p 27017:27017 mongo:latest
- name: Add data to userColl collection
run: mongoimport --collection=userColl --db=appDB --file=userColl.json
- name: Add data to appData Collection
run: mongoimport --collection=appData --db=appDB --file=appData.json
- run: npm install
- run: jest --ci --detectOpenHandles
- run: npm run test:ci
- run: npm run lint
- run: npm run format
- run: npm run build
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"start": "node ./lib/index.js",
"copy-files": "copyfiles -u 1 src/**/*.yml lib",
"dev": "env-cmd -f ./src/config/local.env nodemon ./src/index.ts",
"test": "env-cmd -f ./src/config/test.env jest --ci --detectOpenHandles",
"test": "env-cmd -f ./src/config/test.env jest --detectOpenHandles",
"test:ci": "jest --ci --detectOpenHandles",
"lint": "eslint '**/*.ts'",
"lint-fix": "eslint --fix '**/*.ts'",
"format": "prettier --write 'src/**/*.ts'"
Expand Down

0 comments on commit 837526e

Please sign in to comment.