Merge pull request #172 from noevidence1017/refactor/resilience-loggi… #175
This file contains hidden or 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: 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 |