Skip to content

Commit

Permalink
Merge pull request #1 from Team4159/feature/database
Browse files Browse the repository at this point in the history
Add database
  • Loading branch information
Cow-Van authored Jan 8, 2024
2 parents 3918a9d + 9b7ec3f commit 1237094
Show file tree
Hide file tree
Showing 17 changed files with 564 additions and 134 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/nodejs.tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Tests

on:
push:
branches: ["**"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Setup secrets
shell: python
env:
ENV_FILE: ${{ secrets.ENV_FILE }}
run: |
import os
f = open(".env", "a")
f.write(os.environ["ENV_FILE"])
f.close()
- name: Install packages
run: npm ci
- name: Run tests
run: sudo npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
dist/
test/
logs/
.env
7 changes: 7 additions & 0 deletions basic.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/"
},
"exclude": ["**/tests/**"]
}
184 changes: 156 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"rimraf": "./node_modules/rimraf/bin.js",
"start": "nodemon app.ts",
"build": "rimraf ./dist/ && tsc"
"build": "rimraf ./dist/ && tsc --project basic.tsconfig.json",
"test": "rimraf ./test/ && tsc --project test.tsconfig.json && cross-env NODE_ENV=testing mocha ./test/tests/**/*.spec.js --exit --timeout 10000"
},
"repository": {
"type": "git",
Expand All @@ -19,15 +20,19 @@
},
"homepage": "https://github.com/Team4159/CardinalHoursServerV2#readme",
"devDependencies": {
"@types/chai": "^4.3.11",
"@types/express": "^4.17.21",
"chai": "^5.0.0",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.6",
"chai": "^4.3.10",
"mocha": "^10.2.0",
"typescript": "^5.3.3"
},
"dependencies": {
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"mysql2": "^3.6.5",
"rimraf": "^5.0.5",
"winston": "^3.11.0"
}
Expand Down
Loading

0 comments on commit 1237094

Please sign in to comment.