delta-gitu 0.1.18

An experimental fork of gitu (a git client inspired by Magit), published as a library for delta to embed
Documentation
name: CI

on:
  push:
    branches: [ "main" ]
  pull_request:
  workflow_dispatch:

# A new push to a pull request cancels the run for the push before it.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
  CARGO_TERM_COLOR: always

jobs:
  ci:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v6

    - name: Cache
      uses: actions/cache@v5.0.1
      with:
        path: |
            ~/.cargo/bin
            ~/.cargo/registry
            ~/.cargo/git
            target
        key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}

    - run: git --version
    - run: make test-depend
    # Under a virtual X display, so that there is a clipboard to copy to.
    - run: xvfb-run make test

  test:
    strategy:
      matrix:
        os:
          - windows-latest
          - macos-latest
      fail-fast: false

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v6

    - name: Cache
      uses: actions/cache@v5.0.1
      with:
        path: |
            ~/.cargo/bin
            ~/.cargo/registry
            ~/.cargo/git
            target
        key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}

    # Git's usr\bin first, so that `sh` is the shell itself rather than Git's
    # bin\sh.exe, a launcher that runs it as another process: the tests that
    # stop a command they started need to stop the shell.
    - if: runner.os == 'Windows'
      shell: bash
      run: echo 'C:\Program Files\Git\usr\bin' >> "$GITHUB_PATH"
    - run: git --version
    - run: cargo test