chore: bump pre-commit-hooks to v3.0.0 and rename KREUZBERG_* to XBERG_* #227
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
| name: CI Lint | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".pre-commit-config.yaml" | |
| - ".ai-rulez/**" | |
| - "**/*.rs" | |
| - "**/*.py" | |
| - "**/*.ts" | |
| - "**/*.rb" | |
| - "**/*.php" | |
| - "**/*.go" | |
| - "**/*.java" | |
| - "**/*.ex" | |
| - "**/*.exs" | |
| - "**/*.R" | |
| - "**/*.sh" | |
| - "**/*.toml" | |
| - "**/*.yml" | |
| - "**/*.yaml" | |
| - "**/*.json" | |
| - "alef.toml" | |
| - ".github/workflows/ci-lint.yaml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - ".pre-commit-config.yaml" | |
| - ".ai-rulez/**" | |
| - "**/*.rs" | |
| - "**/*.py" | |
| - "**/*.ts" | |
| - "**/*.rb" | |
| - "**/*.php" | |
| - "**/*.go" | |
| - "**/*.java" | |
| - "**/*.ex" | |
| - "**/*.exs" | |
| - "**/*.R" | |
| - "**/*.sh" | |
| - "**/*.toml" | |
| - "**/*.yml" | |
| - "**/*.yaml" | |
| - "**/*.json" | |
| - "alef.toml" | |
| - ".github/workflows/ci-lint.yaml" | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: ci-lint-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| name: "Validate" | |
| runs-on: ubuntu-24.04-arm | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Task | |
| uses: xberg-io/actions/install-task@v1 # v1 | |
| - name: Setup Rust | |
| uses: xberg-io/actions/setup-rust@v1 # v1 | |
| with: | |
| components: rustfmt, clippy, llvm-tools-preview | |
| - name: Setup Python | |
| uses: xberg-io/actions/setup-python-env@v1 # v1 | |
| with: | |
| python-version: "3.13" | |
| - name: Setup Node Workspace | |
| uses: xberg-io/actions/setup-node-workspace@v1 # v1 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.26.0" | |
| cache-dependency-path: packages/go/go.sum | |
| - name: Install golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| install-only: true | |
| - name: Setup Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "25" | |
| - name: Setup Elixir | |
| uses: xberg-io/actions/setup-elixir@v1 # v1 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: false | |
| - name: Setup PHP | |
| uses: xberg-io/actions/setup-php@v1 # v1 | |
| - name: Setup R | |
| uses: xberg-io/actions/setup-r@v1 # v1 | |
| with: | |
| install-deps-script: scripts/ci/r/install-deps.sh | |
| - name: Install C/C++ tools | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends cppcheck clang-format | |
| - name: Install Alef | |
| uses: xberg-io/actions/install-alef@v1 | |
| - name: Install All Binding Dependencies | |
| run: alef setup | |
| shell: bash | |
| - name: Run Lint Checks | |
| run: task lint:check | |
| shell: bash | |
| - name: Check Code Formatting | |
| run: task format:check | |
| shell: bash | |
| - name: Install alef | |
| uses: xberg-io/actions/install-alef@v1 | |
| - name: Pre-populate alef-hooks cache | |
| # The alef pre-commit hook resolves the binary version from this | |
| # repo's alef.toml `[workspace] alef_version`, then expects the | |
| # binary at ~/.cache/alef-hooks/<ver>/alef-<triple>/alef. Read the | |
| # pin dynamically (avoid drift like the old hard-coded 0.14.30 pin | |
| # that silently rotted as alef released new versions). | |
| shell: bash | |
| run: | | |
| version="$(awk -F'"' '/^alef_version[[:space:]]*=/ {print $2; exit}' alef.toml)" | |
| if [ -z "$version" ]; then | |
| echo "Could not parse alef_version from alef.toml" >&2 | |
| exit 1 | |
| fi | |
| case "$(uname -s)-$(uname -m)" in | |
| Linux-x86_64) target=alef-x86_64-unknown-linux-gnu ;; | |
| Linux-aarch64) target=alef-aarch64-unknown-linux-gnu ;; | |
| Darwin-arm64) target=alef-aarch64-apple-darwin ;; | |
| Darwin-x86_64) target=alef-x86_64-apple-darwin ;; | |
| *) echo "Unsupported platform"; exit 1 ;; | |
| esac | |
| dest="${HOME}/.cache/alef-hooks/${version}/${target}" | |
| mkdir -p "${dest}" | |
| cp "$(command -v alef)" "${dest}/alef" | |
| chmod +x "${dest}/alef" | |
| ls -la "${dest}" | |
| - name: Run Pre-commit Hooks | |
| uses: j178/prek-action@v2 | |
| with: | |
| extra-args: --all-files | |
| - name: Install Python README Dependencies | |
| run: pip install pyyaml jinja2 | |
| shell: bash | |
| - name: Install rumdl | |
| run: pip install 'rumdl==0.1.95' | |
| shell: bash | |
| - name: Validate READMEs | |
| run: task readme:check | |
| shell: bash |