diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fddec90..a331b6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,8 @@ on: workflow_dispatch: jobs: - fmt: - name: fmt + check: + name: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -17,43 +17,16 @@ jobs: with: bun-version: latest - - name: Install dependencies - run: bun install - - - name: Check formatting - run: bun run fmt - - lint: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest + - uses: jdx/mise-action@v3 - name: Install dependencies run: bun install - - name: Run linter - run: bun run lint - - typecheck: - name: type check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install + - name: Add node_modules/.bin to PATH + run: echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH" - - name: Check types - run: bun run typecheck + - name: Run hk check + run: hk check --all --slow test: name: test diff --git a/hk.pkl b/hk.pkl new file mode 100644 index 0000000..209ff93 --- /dev/null +++ b/hk.pkl @@ -0,0 +1,23 @@ +amends "package://github.com/jdx/hk/releases/download/v1.45.0/hk@1.45.0#/Config.pkl" +import "package://github.com/jdx/hk/releases/download/v1.45.0/hk@1.45.0#/Builtins.pkl" + +local linters = new Mapping { + ["prettier"] = Builtins.prettier + ["biome"] = Builtins.biome + ["tsc"] = (Builtins.tsc) { profiles = List("slow") } +} + +hooks { + ["pre-commit"] { + fix = true + stash = "git" + steps = linters + } + ["fix"] { + fix = true + steps = linters + } + ["check"] { + steps = linters + } +} diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..e9211e8 --- /dev/null +++ b/mise.toml @@ -0,0 +1,3 @@ +[tools] +"github:jdx/hk" = "1.45.0" +pkl = "0.31.1"