diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fc6156c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: CI - Test & Coverage + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22.x] + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ“ฆ Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: ๐ŸŸข Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: ๐Ÿ“ฆ Install dependencies + run: pnpm install + + - name: ๐Ÿ”จ Build the app (NestJS) + run: pnpm run build + + - name: ๐Ÿงช Run tests with coverage + run: pnpm run test:cov -t controller + + - name: ๐Ÿ“ค Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage/