Skip to content

Merge pull request #177 from OnyemaAnthony/feat/admin-dashboard-metrics #181

Merge pull request #177 from OnyemaAnthony/feat/admin-dashboard-metrics

Merge pull request #177 from OnyemaAnthony/feat/admin-dashboard-metrics #181

Workflow file for this run

name: SwiftChain Backend CI
on:
push:
branches: ['main', 'develop']
pull_request:
branches: ['main', 'develop']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
mongodb-version: ['6.0']
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.11.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Install dependencies
run: pnpm install
- name: Linting
run: pnpm run lint
- name: Build
run: pnpm run build
- name: Run Tests with Coverage
run: pnpm run test:coverage
env:
CI: true
MONGO_URI: mongodb://localhost:27017/swiftchain_test
JWT_SECRET: test_secret
- name: Upload Coverage Reports
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 30
- name: Comment Coverage Report on PR
if: github.event_name == 'pull_request' && always()
uses: romeovs/lcov-reporter-action@v0.3.1
with:
lcov-file: ./coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true