|
| 1 | +name: 🚀 Validation Pipeline |
| 2 | +concurrency: |
| 3 | + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} |
| 4 | + cancel-in-progress: true |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [main] |
| 8 | + pull_request: |
| 9 | + branches: [main] |
| 10 | +permissions: |
| 11 | + actions: write |
| 12 | + contents: read |
| 13 | + # Required to put a comment into the pull-request |
| 14 | + pull-requests: write |
| 15 | +jobs: |
| 16 | + lint: |
| 17 | + name: ⬣ ESLint |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: 🛑 Cancel Previous Runs |
| 21 | + uses: styfle/cancel-workflow-action@0.11.0 |
| 22 | + |
| 23 | + - name: ⬇️ Checkout repo |
| 24 | + uses: actions/checkout@v3 |
| 25 | + |
| 26 | + - name: ⎔ Setup node |
| 27 | + uses: actions/setup-node@v3 |
| 28 | + with: |
| 29 | + node-version: 20 |
| 30 | + |
| 31 | + - name: 📥 Download deps |
| 32 | + uses: bahmutov/npm-install@v1 |
| 33 | + with: |
| 34 | + useLockFile: false |
| 35 | + |
| 36 | + - name: 🔬 Lint |
| 37 | + run: npm run lint:strict |
| 38 | + |
| 39 | + typecheck: |
| 40 | + name: 🔎 Type check |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - name: 🛑 Cancel Previous Runs |
| 44 | + uses: styfle/cancel-workflow-action@0.11.0 |
| 45 | + - name: ⬇️ Checkout repo |
| 46 | + uses: actions/checkout@v3 |
| 47 | + - name: ⎔ Setup node |
| 48 | + uses: actions/setup-node@v3 |
| 49 | + with: |
| 50 | + node-version: 20 |
| 51 | + - name: 📥 Download deps |
| 52 | + uses: bahmutov/npm-install@v1 |
| 53 | + with: |
| 54 | + useLockFile: false |
| 55 | + - name: 🔎 Type check |
| 56 | + run: npm run typecheck |
| 57 | + |
| 58 | + vitest: |
| 59 | + name: ⚡ Unit Tests |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - name: 🛑 Cancel Previous Runs |
| 63 | + uses: styfle/cancel-workflow-action@0.11.0 |
| 64 | + - name: ⬇️ Checkout repo |
| 65 | + uses: actions/checkout@v3 |
| 66 | + - name: ⎔ Setup node |
| 67 | + uses: actions/setup-node@v3 |
| 68 | + with: |
| 69 | + node-version: 20 |
| 70 | + - name: 📥 Download deps |
| 71 | + uses: bahmutov/npm-install@v1 |
| 72 | + with: |
| 73 | + useLockFile: false |
| 74 | + - name: Install dotenv cli |
| 75 | + run: npm install -g dotenv-cli |
| 76 | + - name: ⚡ Run vitest |
| 77 | + run: npm run test:cov |
| 78 | + - name: "Report Coverage" |
| 79 | + # Only works if you set `reportOnFailure: true` in your vite config as specified above |
| 80 | + if: always() |
| 81 | + uses: davelosert/vitest-coverage-report-action@v2 |
0 commit comments