Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
pull_request:
push:
branches: [ master ]
workflow_dispatch:

jobs:
test:
name: Run Tests & Build
runs-on: ubuntu-latest

services:
mongodb:
image: mongo:6.0
ports:
- 27017:27017
options: >-
--health-cmd="mongosh --eval 'db.adminCommand(\"ping\")'"
--health-interval=10s
--health-timeout=5s
--health-retries=5

env:
MONGO_URL: mongodb://127.0.0.1:27017/worlddriven_test

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Auto format with Prettier
run: npm run format

- name: Run tests
run: npm test

- name: Build project
run: npm run build
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"lint:frontend": "eslint static/js --config frontend.eslint.config.cjs --report-unused-disable-directives --max-warnings 0",
"start": "node src/index.js",
"test": "npm run check && sort-package-json package.json --check && mdspell --en-us --ignore-numbers --report \"*.md\" && write-good --no-adverb README.md CONTRIBUTING.md"
"test": "npm run check && sort-package-json package.json --check && mdspell --en-us --ignore-numbers --report \"*.md\" && write-good --no-adverb README.md CONTRIBUTING.md",
"format": "prettier --write ."
},
"dependencies": {
"connect-mongo": "5.1.0",
Expand Down
Loading