Skip to content

Merge pull request #64 from fizzbuds/lucagiove-patch-1 #210

Merge pull request #64 from fizzbuds/lucagiove-patch-1

Merge pull request #64 from fizzbuds/lucagiove-patch-1 #210

Workflow file for this run

# 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x, 20.x ]
mongodb-version: [ ^4.0.0, ^5.0.0, ^6.0.0 ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
services:
rabbitmq:
image: rabbitmq:3.8
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup MongoDB
run: pnpm install --filter=@fizzbuds/ddd-toolkit mongodb@${{ matrix.mongodb-version }}
- name: Build
run: pnpm run build
- name: Test
run: pnpm run test:ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
version:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: latest
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@fizzbuds'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Create and publish versions
uses: changesets/action@v1
with:
publish: pnpm ci:publish --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
HUSKY: 0