Skip to content

Commit

Permalink
Databases with Continuous Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 committed Mar 7, 2024
1 parent aedfd2a commit 4f48219
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ jobs:
build:
env:
CI: true
MONGO_TEST_URL: ${{ secrets.MONGO_TEST_URL }}
MONGO_URL: mongodb://localhost/nasa
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]
mongodb-version: ['5.0', '6.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: MongoDB in GitHub Actions
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: npm install
- run: npm run build --prefix client
- run: npm test
2 changes: 1 addition & 1 deletion server/tests/launches.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
const { loadPlanetsData } = require('../src/models/planets.model');
const app = require('../src/app');

const USE_TEST_DB = true;
const USE_TEST_DB = !process.env.CI;

beforeAll(async () => {
await mongoConnect(USE_TEST_DB);
Expand Down

0 comments on commit 4f48219

Please sign in to comment.