Skip to content

Commit

Permalink
Continuous Integration & Delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 committed Mar 7, 2024
1 parent 6ea64c8 commit 3e08806
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: NASA Project CI
on:
push:
branches:
- main
# branch created for the CI/CD module
- 05-Continuous-Integration-and-Delivery
pull_request:
branches:
- main
jobs:
build:
env:
CI: true
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"install:server": "npm install --prefix server --",
"install:client": "npm install --prefix client",
"install": "npm run install-server && npm run install-client",
"install": "npm run install:server && npm run install:client",
"server": "npm run watch --prefix server",
"client": "npm start --prefix client",
"watch": "npm run server & npm run client",
Expand Down
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 3e08806

Please sign in to comment.