fix: remove cache: yarn and delete old publish.yml #3
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: Test | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| # auth-db is a library package — unit tests run against an in-memory mock of | |
| # PrismaClient so no real database is required. | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://npm.pkg.github.com | |
| scope: "@backendworks" | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Generate Prisma client | |
| run: npx prisma generate | |
| - name: Run unit tests with coverage | |
| run: npm test | |
| env: | |
| NODE_ENV: test | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: auth-db-coverage | |
| path: coverage/ | |
| retention-days: 7 |