diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 375a355..0053e0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,8 @@ on: branches: ['master'] jobs: - unit: + validate: + name: Validate runs-on: ubuntu-latest steps: @@ -26,6 +27,14 @@ jobs: - name: Install dependencies run: pnpm install + - name: Validate current commit (last commit) with commitlint + if: github.event_name == 'push' + run: pnpm exec commitlint --from HEAD~1 --to HEAD --verbose + + - name: Validate PR commits with commitlint + if: github.event_name == 'pull_request' + run: pnpm exec commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + - name: Run the tests and generate coverage report run: pnpm test -- --coverage