From f18269b983fb962df0f36a8586d770242ed50a64 Mon Sep 17 00:00:00 2001 From: yCOM <83305004+syntaxsec@users.noreply.github.com> Date: Fri, 16 Feb 2024 11:58:16 -0500 Subject: [PATCH] Update node.js.yml yamls suck --- .github/workflows/node.js.yml | 72 +++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 29ebc9b..29ea1ed 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,36 +1,44 @@ 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 - name: Node.js CI - - on: - push: - branches: ["main"] - pull_request: - branches: ["main", "dev"] - - jobs: - build: - name: Backend test - runs-on: ubuntu-latest - - defaults: - run: - working-directory: ./quirknotes/backend - - strategy: - matrix: - node-version: [20.x] - - steps: - - uses: actions/checkout@v3 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - run: mongod --dbpath=./data/db - - run: npm run dev +name: Node.js CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main", "dev"] + +jobs: + build: + name: Backend test + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./quirknotes/backend + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + mongodb-version: ['latest'] + + - name: MongoDB in GitHub Actions + uses: supercharge/mongodb-github-action@v1.10.0 + with: + mongodb-version: ${{matrix.mongodb-version}} + - name: mongo + uses: supercharge/mongodb-github-action@v1.10.0 + with: + mongodb-version: ${{matrix.mongodb-version}} + - run: npm i - - run: npm test + - run: npm run dev & npm test