textcanvas 3.9.0

Draw to the terminal like an HTML Canvas.
Documentation
name: CI

on:
  workflow_call:
  push:
    branches:
      - main
  pull_request:

jobs:
  ci:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target:
          - lint
          - rust-test
          - rust-coverage-pct
          - rust-doc
          - python-test
          - python-coverage-pct

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Rust
        if: ${{ ! startsWith(matrix.target, 'python-') }}
        uses: dtolnay/rust-toolchain@stable

      - name: Set up Just
        uses: taiki-e/install-action@just

      - name: Set up Bun
        if: matrix.target == 'lint'
        uses: oven-sh/setup-bun@v2

      - name: Cache cargo registry and build
        if: ${{ ! startsWith(matrix.target, 'python-') && matrix.target != 'rust-coverage-pct' }}
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry/
            ~/.cargo/git/
            target/
          key:
            ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-${{ matrix.target }}-
            ${{ runner.os }}-cargo-

      - name: Install Tarpaulin
        if: ${{ matrix.target == 'rust-coverage-pct' }}
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-tarpaulin

      - name: Set up Python
        if: ${{ startsWith(matrix.target, 'python-') }}
        uses: actions/setup-python@v5
        with:
          python-version: 3.12

      - name: Set up `uv`
        if: ${{ startsWith(matrix.target, 'python-') }}
        uses: astral-sh/setup-uv@v6

      - name: Cache prek
        if: ${{ matrix.target == 'lint' }}
        uses: actions/cache@v4
        with:
          path: ~/.cache/prek/
          key:
            ${{ runner.os }}-prek-${{ hashFiles('**/.pre-commit-config.yaml') }}
          restore-keys: |
            ${{ runner.os }}-prek-

      - name: Install prek
        if: ${{ matrix.target == 'lint' }}
        uses: taiki-e/install-action@v2
        with:
          tool: prek

      - name: Run Justfile target
        run: just ${{ matrix.target }}