git-trim 0.4.2

Automatically trims your tracking branches whose upstream branches are merged or stray
Documentation
name: CI

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1.0.5
      with:
        profile: minimal
        components: rustfmt
    - uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install pre-commit
      run: |
        pip install pre-commit
        pre-commit install --config .pre-commit-config.actions.yaml
    - name: pre-commit
      run: |
        pre-commit run --config .pre-commit-config.actions.yaml --all-files --show-diff-on-failure

  clippy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1.0.5
      with:
        profile: minimal
        components: clippy
    - run: cargo fetch --verbose
    - uses: actions-rs/clippy-check@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        args: --all-features

  test:
    runs-on: ${{ matrix.os.long }}
    strategy:
      matrix:
        os:
        - long: ubuntu-latest
          short: linux
        - long: macOS-latest
          short: mac
        - long: windows-latest
          short: win
      fail-fast: false
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1.0.5
      with:
        profile: minimal
    - run: cargo fetch --verbose
    - run: cargo build --tests
    - run: cargo test --all
      shell: bash
      env:
        RUST_LOG: trace
        RUST_BACKTRACE: 1

  build:
    runs-on: ${{ matrix.os.long }}
    strategy:
      matrix:
        os:
        - long: ubuntu-latest
          short: linux
        - long: macOS-latest
          short: mac
        - long: windows-latest
          short: win
      fail-fast: false
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1.0.5
      with:
        profile: minimal
    - run: cargo fetch --verbose
    - run: cargo build
    - name: Archive
      shell: bash
      working-directory: target/debug
      run: |
        VERSION=$(./git-trim --version | cut -d ' ' -f 2)
        echo "VERSION=$VERSION" >> $GITHUB_ENV

        rm -rf artifacts
        mkdir -p artifacts
        cp 'git-trim' artifacts/
        echo '${{github.sha}} ${{github.ref}}' | tee artifacts/git-ref
        if command -v sha256sum; then
            sha256sum 'git-trim' | tee artifacts/sha256sums
        else
            shasum -a 256 'git-trim' | tee artifacts/sha256sums
        fi

    - uses: actions/upload-artifact@v1
      with:
        name: git-trim-${{matrix.os.short}}-${{env.VERSION}}
        path: target/debug/artifacts/

  docs-are-up-to-date:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1.0.5
      with:
        profile: minimal
    - run: cargo fetch --verbose
    - run: ./build-man.sh build
    - run: ./build-man.sh run
    - name: Check docs are up-to-date
      run: git diff --exit-code HEAD -- docs