Skip to content

Commit 88fa924

Browse files
committed
Adopt mise as the primary task runner
Add mise tasks for common development workflows including deps, check, test, build, fmt, coverage, and publish. This replaces the need to remember various deno task commands and provides a consistent interface. Git hooks are now managed by mise's generate git-pre-commit feature instead of @hongminhee/deno-task-hooks. The hooks:install task now uses mise generate to create pre-commit and pre-push hooks. Update CI/CD workflow to use jdx/mise-action for consistent tool version management across all jobs. This replaces individual setup actions for Deno, Node.js, Bun, and pnpm. The workflow is restructured into separate jobs (check, test-deno, test-node, test-bun) with multi-platform testing for all runtimes. Update AGENTS.md to reflect the new mise-based development workflow.
1 parent d24a492 commit 88fa924

4 files changed

Lines changed: 244 additions & 113 deletions

File tree

.github/workflows/main.yaml

Lines changed: 103 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
11
name: main
2-
on: [push, pull_request]
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
tags:
8+
- "*.*.*"
9+
branches:
10+
- "*"
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
MISE_EXPERIMENTAL: true
318

419
jobs:
5-
test:
20+
check:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: jdx/mise-action@v2
26+
with:
27+
version: 2025.12.12
28+
- run: mise run deps
29+
- run: mise run check
30+
31+
test-deno:
632
strategy:
733
matrix:
834
os: [macos-latest, ubuntu-latest, windows-latest]
@@ -13,6 +39,7 @@ jobs:
1339
checks: write
1440
pull-requests: write
1541
runs-on: ${{ matrix.os }}
42+
timeout-minutes: 15
1643
env:
1744
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
1845
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -22,18 +49,9 @@ jobs:
2249
git config --global core.autocrlf false
2350
git config --global core.eol lf
2451
- uses: actions/checkout@v4
25-
- uses: denoland/setup-deno@v2
26-
with:
27-
deno-version: v2.x
28-
- uses: pnpm/action-setup@v4
52+
- uses: jdx/mise-action@v2
2953
with:
30-
version: latest
31-
- uses: actions/setup-node@v4
32-
with:
33-
node-version: latest
34-
- uses: oven-sh/setup-bun@v2
35-
with:
36-
bun-version: latest
54+
version: 2025.12.12
3755
- run: deno task test --coverage=.cov --junit-path=.test-report.xml
3856
- uses: EnricoMi/publish-unit-test-result-action@v2
3957
if: runner.os == 'Linux' && always()
@@ -50,59 +68,90 @@ jobs:
5068
with:
5169
check_name: "Test Results (Windows)"
5270
files: .test-report.xml
53-
- if: '!cancelled()'
71+
- if: runner.os == 'Linux' && !cancelled()
5472
uses: codecov/test-results-action@v1
5573
with:
5674
token: ${{ secrets.CODECOV_TOKEN }}
5775
files: .test-report.xml
58-
- run: deno coverage --lcov .cov > .cov.lcov
59-
- uses: codecov/codecov-action@v4
76+
- if: runner.os == 'Linux'
77+
run: deno coverage --lcov .cov > .cov.lcov
78+
- if: runner.os == 'Linux'
79+
uses: codecov/codecov-action@v4
6080
with:
6181
token: ${{ secrets.CODECOV_TOKEN }}
6282
slug: dahlia/logtape
6383
file: .cov.lcov
64-
- run: pnpm install
65-
- run: deno task test:node
66-
- run: deno task test:bun
67-
- run: deno task check
84+
85+
test-node:
86+
strategy:
87+
matrix:
88+
os: [macos-latest, ubuntu-latest, windows-latest]
89+
fail-fast: false
90+
runs-on: ${{ matrix.os }}
91+
timeout-minutes: 15
92+
steps:
93+
- run: |
94+
git config --global core.autocrlf false
95+
git config --global core.eol lf
96+
- uses: actions/checkout@v4
97+
- uses: jdx/mise-action@v2
98+
with:
99+
version: 2025.12.12
100+
- run: mise run deps
101+
- run: mise run build
102+
- run: mise run test:node
103+
104+
test-bun:
105+
strategy:
106+
matrix:
107+
os: [macos-latest, ubuntu-latest, windows-latest]
108+
fail-fast: false
109+
runs-on: ${{ matrix.os }}
110+
timeout-minutes: 15
111+
steps:
112+
- run: |
113+
git config --global core.autocrlf false
114+
git config --global core.eol lf
115+
- uses: actions/checkout@v4
116+
- uses: jdx/mise-action@v2
117+
with:
118+
version: 2025.12.12
119+
- run: mise run deps
120+
- run: mise run build
121+
- run: mise run test:bun
68122

69123
publish:
70-
needs: [test]
124+
if: github.event_name == 'push'
125+
needs: [check, test-deno, test-node, test-bun]
71126
permissions:
72127
contents: read
73128
id-token: write
74129
runs-on: ubuntu-latest
130+
timeout-minutes: 15
75131
steps:
76132
- uses: actions/checkout@v4
77-
- uses: denoland/setup-deno@v2
78-
with:
79-
deno-version: v2.x
80-
- uses: pnpm/action-setup@v4
81-
with:
82-
version: latest
83-
- uses: actions/setup-node@v4
133+
- uses: jdx/mise-action@v2
84134
with:
85-
node-version: latest
86-
- run: sudo npm install -g npm@latest
87-
- if: github.ref_type == 'branch'
88-
run: |
89-
v="$(jq \
90-
--raw-output \
91-
--arg build "$GITHUB_RUN_NUMBER" \
92-
--arg commit "${GITHUB_SHA::8}" \
93-
'.version + "-dev." + $build + "+" + $commit' \
94-
packages/logtape/deno.json)"
95-
deno run --allow-read --allow-write scripts/update_versions.ts "$v"
96-
deno task check:versions
97-
- if: github.ref_type == 'tag'
98-
run: |
135+
version: 2025.12.12
136+
- run: mise run deps
137+
- run: |
99138
set -ex
100-
[[ "$(jq -r .version packages/logtape/deno.json)" = "$GITHUB_REF_NAME" ]]
101-
deno task check:versions
102-
- if: github.event_name == 'push'
103-
run: |
139+
if [[ "$GITHUB_REF_TYPE" == tag ]]; then
140+
mise run check-versions
141+
[[ "$(jq -r '.version' packages/logtape/deno.json)" == "$GITHUB_REF_NAME" ]]
142+
else
143+
v="$(jq \
144+
--raw-output \
145+
--arg build "$GITHUB_RUN_NUMBER" \
146+
--arg commit "${GITHUB_SHA::8}" \
147+
'.version + "-dev." + $build + "+" + $commit' \
148+
packages/logtape/deno.json)"
149+
deno run --allow-read --allow-write scripts/update_versions.ts "$v"
150+
mise run check-versions
151+
fi
152+
- run: mise run build
153+
- run: |
104154
set -ex
105-
deno task build
106155
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
107156
pnpm publish -r --filter './packages/*' --force --no-git-checks --access public --tag latest
108157
else
@@ -111,14 +160,15 @@ jobs:
111160
env:
112161
NPM_CONFIG_PROVENANCE: "true"
113162
- if: github.event_name == 'pull_request'
114-
run: deno task publish --dry-run --allow-dirty
163+
run: deno publish --dry-run --allow-dirty
115164
- if: github.event_name == 'push'
116-
run: deno task publish --allow-dirty
165+
run: deno publish --allow-dirty
117166

118167
publish-docs:
119168
if: github.event_name == 'push'
120169
needs: [publish]
121170
runs-on: ubuntu-latest
171+
timeout-minutes: 10
122172
permissions:
123173
id-token: write
124174
pages: write
@@ -128,17 +178,11 @@ jobs:
128178
url: ${{ steps.deployment.outputs.page_url }}
129179
steps:
130180
- uses: actions/checkout@v4
131-
- uses: denoland/setup-deno@v2
132-
with:
133-
deno-version: v2.x
134-
- uses: pnpm/action-setup@v4
135-
with:
136-
version: latest
137-
- uses: actions/setup-node@v4
181+
- uses: jdx/mise-action@v2
138182
with:
139-
node-version: '24'
140-
- run: pnpm install
141-
- run: deno task build
183+
version: 2025.12.12
184+
- run: mise run deps
185+
- run: mise run build
142186
- run: |
143187
set -ex
144188
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then

AGENTS.md

Lines changed: 71 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -251,21 +251,17 @@ The project supports testing across multiple JavaScript runtimes:
251251

252252
~~~~ bash
253253
# Run Deno tests only
254-
deno task test
254+
mise run test:deno
255255

256256
# Run tests with coverage (Deno)
257-
deno task coverage
257+
mise run coverage
258258

259259
# Run tests across ALL runtimes (Deno, Node.js, Bun)
260-
deno task test-all
260+
mise run test
261261

262262
# Run tests for specific runtime
263-
deno task test:node # Node.js only
264-
deno task test:bun # Bun only
265-
266-
# Individual package testing
267-
deno task test:node:logtape # Test logtape package in Node.js
268-
deno task test:bun:file # Test file package in Bun
263+
mise run test:node # Node.js only
264+
mise run test:bun # Bun only
269265
~~~~
270266

271267
### Test workflow
@@ -280,6 +276,43 @@ For Node.js and Bun testing:
280276
Development workflow
281277
--------------------
282278

279+
### Task runner
280+
281+
The project uses [mise] as the primary task runner. All common development
282+
tasks are available through `mise run`:
283+
284+
~~~~ bash
285+
# List all available tasks
286+
mise tasks
287+
288+
# Install dependencies
289+
mise run deps
290+
291+
# Check code (formatting, linting, type checking)
292+
mise run check
293+
294+
# Run tests
295+
mise run test # All runtimes (includes check)
296+
mise run test:deno # Deno only
297+
mise run test:node # Node.js only
298+
mise run test:bun # Bun only
299+
300+
# Build packages
301+
mise run build
302+
303+
# Format code
304+
mise run fmt
305+
306+
# Other useful tasks
307+
mise run coverage # Run tests with coverage
308+
mise run check-versions # Check version consistency
309+
mise run update-versions # Update versions
310+
mise run hooks:install # Install git hooks
311+
mise run publish # Publish to JSR
312+
~~~~
313+
314+
[mise]: https://mise.jdx.dev/
315+
283316
### Build system
284317

285318
The project uses *tsdown* for cross-platform package building:
@@ -293,64 +326,68 @@ The project uses *tsdown* for cross-platform package building:
293326

294327
~~~~ bash
295328
# Build all packages
296-
deno task build
297-
298-
# Build specific packages
299-
deno task build:logtape
300-
deno task build:file
301-
deno task build:otel
302-
deno task build:redaction
303-
deno task build:sentry
329+
mise run build
304330
~~~~
305331

306332
### Checking code
307333

308334
Before submitting changes, run:
309335

310336
~~~~ bash
311-
deno task check
337+
mise run check
312338
~~~~
313339

314340
This runs:
315341

316342
- `deno check`: Type checking across all workspace members
317343
- `deno lint`: Linting
318344
- `deno fmt --check`: Format checking
319-
- `deno task check:versions`: Version consistency check across packages
345+
- `mise run check-versions`: Version consistency check across packages
320346

321347
### Workspace vs package-level tasks
322348

323-
- *Workspace-level tasks*: Run from the root directory using `deno task`
324-
- *Package-level tasks*: Run from individual package directories or using `-f`
325-
flag
349+
- *Workspace-level tasks*: Run from the root directory using `mise run`
350+
- *Package-level tasks*: Run from individual package directories
326351
- Cross-runtime testing requires building packages first
327352

328353
### Git hooks
329354

330-
The project uses git hooks:
355+
The project uses git hooks managed by mise's `generate git-pre-commit` feature:
331356

332-
- *pre-commit*: Runs `deno task check` to verify code quality
333-
- *pre-push*: Runs `deno task check` and `deno task test` to verify
334-
functionality
357+
- *pre-commit*: Runs `mise run hooks:pre-commit` (which depends on `check`)
358+
- *pre-push*: Runs `mise run hooks:pre-push` (which depends on `check` and
359+
`test:deno`)
335360

336361
To install hooks:
337362

338363
~~~~ bash
339-
deno task hooks:install
364+
mise run hooks:install
340365
~~~~
341366

367+
This generates the hook scripts in *.git/hooks/* using
368+
`mise generate git-pre-commit`.
369+
342370
### CI/CD
343371

344-
The project uses GitHub Actions for:
372+
The project uses GitHub Actions with [jdx/mise-action] to manage all tool
373+
versions consistently. The workflow is structured as separate jobs:
374+
375+
- *check*: Code formatting, linting, and type checking
376+
- *test-deno*: Deno tests across multiple platforms (macOS, Ubuntu, Windows)
377+
- *test-node*: Node.js tests
378+
- *test-bun*: Bun tests
379+
- *publish*: Publishing to JSR and npm
380+
- *publish-docs*: Documentation deployment
345381

346-
- Running tests across multiple platforms (macOS, Ubuntu, Windows)
347-
- Cross-runtime testing (Deno, Node.js, Bun)
348-
- Checking code style and types
349-
- Building packages with tsdown
350-
- Generating test coverage reports
351-
- Publishing to JSR and npm
382+
Key features:
383+
384+
- Tool versions are managed by mise (defined in *mise.toml*)
385+
- Concurrency control to cancel redundant workflow runs
386+
- Test coverage reporting via Codecov
352387
- Monorepo-aware package publishing
353388

389+
[jdx/mise-action]: https://github.com/jdx/mise-action
390+
354391

355392
Documentation
356393
-------------

0 commit comments

Comments
 (0)