Repository navigation
add: run mise lint on GitHub Actions. - #367
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
変更理由
Closes #352
mise run lintは手元でしか走らず、走らせるかどうかは人と agent の規律に任されていた。CI で走らせるかを試作して判断し、#352 の選択肢 B(ubuntu のランナーでmise run lintを回す)を、必須チェックにしない形で採る。判断の根拠(#352 の判断基準への答え):
XDG_CONFIG_HOMEを[dotfiles]のリンクの代わりにするapt install zshmise installを自分で実行する(下記)lint:nvimが CI で走るか: 走る。plugin の取得は約 1 秒。そのために、lint:nvimの中の順番を変えた(下記)。変更内容
add: run mise lint on GitHub Actions.—.github/workflows/lint.ymlを足した。mise run lintを回すpermissions: contents: readだけ。secret は使わない(fork からの PR でも同じ権限で走る)XDG_CONFIG_HOMEを.configに向け、[dotfiles]のリンク(~/.config/*→.config/*)と同じ状態にする。mise の global config・nvim・git が手元と同じファイルを読むtimeout-minutes: 15。plugin の取得に失敗すると、nvim の smoke テストがエラーを出したまま終了しない(手元で確認)actions/checkoutv7.0.1、jdx/mise-actionv5.1.1)fix: install the global mise tools without --locked in CI.— mise-action はmise.lockがあるとmise install --lockedを実行する。global config のツールは lockfile に無いので、24 個全てが「not in the lockfile」で失敗した。action の install を止め(install: false)、mise installを自分で実行する。github:のツールを取得するときの API の制限を避けるため、MISE_GITHUB_TOKENにgithub.tokenを渡す。fix: fetch nvim plugins before emmylua_check in lint.— plugin が未取得の環境では、emmylua_checkが plugin の module を解決できず、warning が error 扱いになって落ちた。lint:nvimの中で、plugin を取得する smoke テストを先に走らせる。手元でも、plugin が未取得の新しいマシンでmise run lintが通るようになる。docs: note the CI lint run in AGENTS.md.— AGENTS.md「Verification」に、CI でも同じlintが走ること、必須ではないのでマージ前にgh pr checksで確かめること、macOS 固有の差は CI で検出されないので手元のlintを省かないことを足した。影響範囲
対象: CI(
.github/)/ mise(mise-tasks/lint/nvim)/ AGENTS.mdmise run lintのlint:nvimの中の順番が変わる。検査の中身は同じ。レビューの着目点
contents: readだけで、secret も使わない。MISE_GITHUB_TOKENに渡すのは、その job のgithub.token(読み取り専用)。mise installに約 33 秒かかる。確認手順
ubuntu-24.04 のランナーでの結果(run 38126088312):
mise install(global config の全ツール)mise run lintmise run lintのログで、test:scriptsの 6 テスト(repo・wt・block-piped-excluded・block-secret-read・pre-push・ui)、smoke テスト、emmylua_checkが全て通っている。試作の途中で落ちた run と、その原因:
mise install --lockedで、global config の 24 ツールが失敗した → 2 で直したemmylua_checkが plugin の module を解決できなかった → 3 で直した範囲外 / 既知の問題
nvim-pack-lock.jsonと違う rev の plugin が入る疑いがある → plugin 未取得の環境で Neovim を起動すると、nvim-pack-lock.json と違う rev の plugin が入る #368。CI も新しいランナーで plugin を取得するので、直るまでは lockfile と違う版の plugin で検査している可能性がある。keymaps.luaのlocal map = vim.keymap.setに、emmylua_checkが hint(preferred-local-alias)を出す。hint なので lint は落ちない。