This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
diagram: sequence #119
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NestJS CI | |
on: | |
pull_request: | |
branches: [ "develop" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x, 22.x] | |
mongodb-version: ['7.0', '8.0'] | |
redis-version: [6, 7] | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Start MongoDB | |
uses: supercharge/mongodb-github-action@1.11.0 | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
mongodb-replica-set: test-rs | |
- name: Start Redis | |
uses: supercharge/redis-github-action@1.7.0 | |
with: | |
redis-version: ${{ matrix.redis-version }} | |
- run: npm install | |
- run: npm run build --if-present | |
- run: npm run test:cov | |
- name: Check Test Results | |
run: | | |
if [ $? -ne 0 ]; then | |
echo "Test failed. Exiting with non-zero status." | |
exit 1 | |
fi |