Skip to content

Establish GitHub Actions CI Pipeline #9

Establish GitHub Actions CI Pipeline

Establish GitHub Actions CI Pipeline #9

Workflow file for this run

name: HRM Dashboard - CI
on:
push:
branches:
- leader
pull_request:
branches:
- leader
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm run lint
- name: Type check
run: pnpm exec tsc --noEmit
- name: Knip
run: pnpm run knip
- name: Format check
run: pnpm run format:check
- name: Security audit
run: pnpm audit --prod --audit-level=high
- name: Validate PR commits
if: github.event_name == 'pull_request'
id: lint
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Post Comment on Failure
if: failure() && steps.lint.conclusion == 'failure'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
:no_entry: **Commit Message Linting Failed**
One or more of your commit messages do not follow the project's conventions.
Please review the [commitlint logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
You can also refer to the [commit message guidelines](https://github.com/conventional-changelog/commitlint/#what-is-commitlint) for help.