Skip to content

Merge pull request #2 from r34son/commitlint #10

Merge pull request #2 from r34son/commitlint

Merge pull request #2 from r34son/commitlint #10

Workflow file for this run

name: CI
on:
push:
branches: ['master']
pull_request:
branches: ['master']
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: |
pnpm exec commitlint \
--from ${{ github.event.before }} \
--to ${{ github.event.after }} \
--verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: |
pnpm exec commitlint \
--from ${{ github.event.pull_request.base.sha }} \
--to ${{ github.event.pull_request.head.sha }} \
--verbose
- name: Run the tests and generate coverage report
run: pnpm test -- --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}