Skip to content

Drop Python support #185

Drop Python support

Drop Python support #185

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
# Cancel any in-progress run on the same ref when a new commit lands.
# Groups by workflow + ref so main and each PR branch have independent
# queues — a new push to PR #42 cancels the old PR #42 run but leaves
# a concurrent main run alone.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Install stow
run: sudo apt-get update && sudo apt-get install -y stow
# shellcheck comes from the platform package manager rather than mise
# (Homebrew on macOS, the runner image here), so there is nothing to
# install — ubuntu-latest ships it preinstalled. Its version trails
# Homebrew's, so a check introduced in a newer shellcheck can fire
# locally without failing CI; `make test` locally is the stricter gate.
- name: make test
run: make test
fish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: fish-actions/install-fish@v1
# Discover every tracked .fish file via git ls-files so moving fish
# config between stow packages (or anywhere in the tree) doesn't
# break this job. -n1 invokes fish once per file so a syntax error
# in any one file propagates through xargs as a nonzero exit.
- name: Validate fish syntax
run: git ls-files -z '*.fish' | xargs -0 -r -n1 fish -n
lua:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
# Locate the directory containing stylua.toml dynamically. stylua
# walks up from each target file looking for a config, so passing
# that directory is enough — no hardcoded -f path. Immune to
# moving the nvim tree between packages.
- name: Find lua project root
id: lua_root
run: |
config=$(git ls-files '*stylua.toml' | head -1)
if [ -z "$config" ]; then
echo "no stylua.toml found in repo" >&2
exit 1
fi
echo "dir=$(dirname "$config")" >> "$GITHUB_OUTPUT"
# stylua's version is pinned in exactly one place
# (common/.config/mise/config.toml) instead of being duplicated into an
# action input. `install: false` then installing one tool by name avoids
# bootstrapping the whole [tools] table.
- uses: jdx/mise-action@v4
with:
install: false
- name: Check formatting
env:
MISE_GLOBAL_CONFIG_FILE: common/.config/mise/config.toml
run: |
mise install stylua
mise exec -- stylua --check "${{ steps.lua_root.outputs.dir }}"
codespace-tools:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# The variable that actually matters is glibc version, not distro.
# tree-sitter installs by running the prebuilt binary and falling back
# to a cargo build when it won't execute, so the matrix only needs one
# image on each side of that branch:
# ubuntu:22.04 = glibc 2.35 -> prebuilt won't run, cargo fallback
# ubuntu:24.04 = glibc 2.39 -> prebuilt binary runs directly
# Additional older images (ubuntu:20.04, debian:12) exercised the exact
# same fallback path and only added cargo build time.
image: ["ubuntu:22.04", "ubuntu:24.04"]
container:
image: ${{ matrix.image }}
env:
GH_TOKEN: ${{ github.token }}
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install base dependencies
run: |
apt-get update
apt-get install -y sudo curl git
- name: Install gh CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
| tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt-get update
apt-get install -y gh
- name: Install Rust toolchain (glibc < 2.39 uses cargo fallback)
if: matrix.image != 'ubuntu:24.04'
run: |
apt-get install -y build-essential libclang-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- uses: actions/checkout@v6
- name: Run install-codespace-tools
run: script/install-codespace-tools
- name: Verify all tools installed
run: |
export PATH="$HOME/.local/bin:$PATH"
failed=0
# Run each tool's version flag WITHOUT a pipe so its own exit
# status is checked — a binary that's on PATH but broken at
# runtime (e.g. a glibc mismatch) must fail this job, not pass.
# diff-so-fancy has no version flag, so it's checked by presence.
verify() {
local tool=$1 flag=$2 out
if ! command -v "$tool" >/dev/null 2>&1; then
printf " ✗ %s: NOT FOUND\n" "$tool"; failed=1; return
fi
if [ "$flag" = none ]; then
printf " ✓ %s: present\n" "$tool"; return
fi
if out=$("$tool" "$flag" </dev/null 2>&1); then
printf " ✓ %s: %s\n" "$tool" "$(printf '%s' "$out" | head -1)"
else
printf " ✗ %s: present but won't run: %s\n" \
"$tool" "$(printf '%s' "$out" | head -1)"
failed=1
fi
}
verify nvim --version
verify tree-sitter --version
verify tmux -V
verify rg --version
verify bat --version
verify fzf --version
verify lazygit --version
verify diff-so-fancy none
exit "$failed"