summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-01-31 10:55:17 +1100
committerDamien George <damien@micropython.org>2024-02-07 15:19:38 +1100
commit84e90639fa47a6830b53138d546dd8694549be36 (patch)
treee244b8b2b0eb365959d3204a5d5ea95a2950726c
parentb038d070116ccfb1ec785cd6207006783841bccc (diff)
github/workflows: Move codespell to a GitHub workflow, version it.
Similar to ruff.yaml, it's simpler to run the codespell command directly from a workflow file. And developers can run codespell directly from the command line without the need for options, or just use pre-commit. This commit also applies a specific version to codespell, same as pre-commit (introduced in a166d805f43). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-rw-r--r--.github/workflows/code_formatting.yml10
-rw-r--r--.github/workflows/codespell.yml12
-rwxr-xr-xtools/ci.sh11
3 files changed, 12 insertions, 21 deletions
diff --git a/.github/workflows/code_formatting.yml b/.github/workflows/code_formatting.yml
index 5cd7984f7..9f30f048c 100644
--- a/.github/workflows/code_formatting.yml
+++ b/.github/workflows/code_formatting.yml
@@ -18,13 +18,3 @@ jobs:
run: source tools/ci.sh && ci_c_code_formatting_run
- name: Check code formatting
run: git diff --exit-code
-
- code-spelling:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- - name: Install packages
- run: source tools/ci.sh && ci_code_spell_setup
- - name: Run spell checker
- run: source tools/ci.sh && ci_code_spell_run
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
new file mode 100644
index 000000000..47b12051e
--- /dev/null
+++ b/.github/workflows/codespell.yml
@@ -0,0 +1,12 @@
+name: Check spelling with codespell
+
+on: [push, pull_request]
+
+jobs:
+ codespell:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: pip install --user codespell==2.2.6 tomli
+ - run: codespell
+
diff --git a/tools/ci.sh b/tools/ci.sh
index e18027ae5..3cbc51cfa 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -31,17 +31,6 @@ function ci_c_code_formatting_run {
}
########################################################################################
-# code spelling
-
-function ci_code_spell_setup {
- pip3 install codespell tomli
-}
-
-function ci_code_spell_run {
- codespell
-}
-
-########################################################################################
# commit formatting
function ci_commit_formatting_run {