-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (67 loc) · 2 KB
/
ci.yml
File metadata and controls
73 lines (67 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
commitlint:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
# For pull_request events, default checkout is a merge commit which may not be conventional.
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Check commit messages
uses: cocogitto/cocogitto-action@v4
with:
command: check
# Only lint the commits introduced by this PR/push, not the entire repo history.
args: ${{ github.event_name == 'pull_request' && format('{0}..{1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha) || format('{0}..{1}', github.event.before, github.sha) }}
check:
name: Lint and Typecheck
runs-on: ubuntu-latest
needs: commitlint
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
# Infer from bun.lock
version: ""
working-dir: .
- name: Biome CI
run: biome ci .
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install dependencies
run: bun install --frozen-lockfile --ignore-scripts
- name: Typecheck
run: bun run check:types
- name: Knip
run: bun run check:unused
test:
name: Tests
runs-on: ubuntu-latest
needs: commitlint
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install dependencies
run: bun install --frozen-lockfile --production --ignore-scripts
- name: Run tests
run: bun test