|
name: CI |
|
|
|
on: |
|
push: |
|
branches: |
|
- main |
|
pull_request: |
|
branches: |
|
- main |
|
|
|
permissions: |
|
contents: read |
|
|
|
concurrency: |
|
group: ${{ github.workflow }}-${{ github.ref }} |
|
cancel-in-progress: true |
|
|
|
jobs: |
|
ci: |
|
runs-on: ubuntu-latest |
|
services: |
|
postgres: |
|
image: postgres |
|
env: |
|
POSTGRES_PASSWORD: postgres |
|
ports: |
|
- 5432:5432 |
|
options: >- |
|
--health-cmd pg_isready |
|
--health-interval 10s |
|
--health-timeout 5s |
|
--health-retries 5 |
|
steps: |
|
- uses: actions/checkout@v7 |
|
- uses: jdx/mise-action@v4.2.5 |
|
- run: npm ci |
|
- run: npm run ci |
|
- uses: codecov/codecov-action@v7 |
|
with: |
|
token: ${{ secrets.CODECOV_TOKEN }} |
|
ci-bun: |
|
runs-on: ubuntu-latest |
|
services: |
|
postgres: |
|
image: postgres |
|
env: |
|
POSTGRES_PASSWORD: postgres |
|
ports: |
|
- 5432:5432 |
|
options: >- |
|
--health-cmd pg_isready |
|
--health-interval 10s |
|
--health-timeout 5s |
|
--health-retries 5 |
|
steps: |
|
- uses: actions/checkout@v7 |
|
- uses: jdx/mise-action@v4.2.5 |
|
- run: npm ci |
|
- run: bun run ci:bun |
|
# https://commitlint.js.org/guides/ci-setup.html |
|
commitlint: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@v7 |
|
with: |
|
fetch-depth: 0 |
|
- uses: jdx/mise-action@v4.2.5 |
|
- run: npm install -D @commitlint/cli @commitlint/config-conventional |
|
- name: Validate current commit (last commit) with commitlint |
|
if: github.event_name == 'push' |
|
run: npx commitlint --last --verbose |
|
- name: Validate PR commits with commitlint |
|
if: github.event_name == 'pull_request' |
|
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose |