Skip to content

feat: workflow

feat: workflow #6

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
MONGO_INITDB_ROOT_ROLE: dbOwner
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Create .env.test file
env:
PORT: ${{ secrets.PORT }}
NODE_ENV: development
JWT_SECRET: ${{ secrets.JWT_SECRET }}
ORIGIN: "*"
run: |
echo "PORT=${PORT}" >> .env.test
echo "MONGODB_URI=mongodb://test:test@localhost:27017" >> .env.test
echo "NODE_ENV=${NODE_ENV}" >> .env.test
echo "JWT_SECRET=${JWT_SECRET}" >> .env.test
echo "ORIGIN=${ORIGIN}" >> .env.test
- name: Run Jest tests
needs: mongodb

Check failure on line 45 in .github/workflows/dev_test.yml

View workflow run for this annotation

GitHub Actions / Run Tests

Invalid workflow file

The workflow is not valid. .github/workflows/dev_test.yml (Line: 45, Col: 9): Unexpected value 'needs'
run: npm test