Skip to content

make test deterministic #24

make test deterministic

make test deterministic #24

Workflow file for this run

name: Pipeline
on: push
jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18.x', '20.x']
mongo-version: ['5', '6', '7']
steps:
- uses: actions/checkout@v4
- run: MONGO_VERSION=${{ matrix.mongo-version }} docker-compose up -d
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
- run: npm install
- run: npm run lint
- run: npm run format-check
- run: npm run build
- run: npm test
env:
CI: true
- run: docker-compose down
if: always()
- run: npx codecov
if: matrix.node-version == '18.x' && matrix.mongo-version == '5'
publish:
if: github.ref == 'refs/heads/main'
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: https://registry.npmjs.org
- run: npm info $(node -p "require('./package.json').name")@$(node -p "require('./package.json').version") || ALREADY_PUBLISHED=1
- run: npm install
if: env.ALREADY_PUBLISHED != 1
- run: npm run build
if: env.ALREADY_PUBLISHED != 1
- run: npm run publish
if: env.ALREADY_PUBLISHED != 1
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}