foreman 1.7.0

Toolchain manager for simple binary tools
name: CI

on:
  push:
    branches:
      - main

  pull_request:
    branches:
      - main

jobs:
  checks:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v2

      - name: Setup Rust toolchain
        shell: bash
        run: rustup default stable

      - name: Rustfmt
        shell: bash
        run: cargo fmt -- --check

      - name: Clippy
        shell: bash
        run: cargo clippy

  build:
    needs: checks
    timeout-minutes: 20
    strategy:
      matrix:
        os: [ windows-latest, ubuntu-22.04 ]
        rust_version: [ stable, "1.88.0" ]

    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2

      - name: Setup Rust toolchain
        run: rustup default ${{ matrix.rust_version }}

      - name: Build
        run: cargo build --locked --verbose

      - name: Run tests
        run: cargo test --locked --verbose

  end-to-end-tests-ubuntu:
    runs-on: ubuntu-22.04
    needs: build
    steps:
      - uses: actions/checkout@v2

      - name: End-to-end tests ubuntu
        shell: bash
        run: |
          cargo install --path .
          foreman --version
          PATH=$PATH:~/.foreman/bin
          ./scripts/end-to-end-tests.sh

  end-to-end-tests-windows:
    runs-on: windows-latest
    needs: build
    steps:
      - uses: actions/checkout@v2

      - name: install foreman from source
        shell: pwsh
        run: |
          cargo install --path .
          foreman --version

      - name: End-to-end tests windows
        shell: bash
        run: |
          PATH=$PATH:~/.foreman/bin
          ./scripts/end-to-end-tests.sh

  kill-process-test-unix:
    runs-on: ubuntu-22.04
    needs: build
    steps:
      - uses: actions/checkout@v2

      - name: kill-process-test-unix
        shell: bash
        run: |
          cargo install --path .
          foreman --version
          PATH=$PATH:~/.foreman/bin
          ./scripts/kill-process-test-unix.sh

  kill-process-test-windows:
    runs-on: windows-latest
    needs: build
    steps:
      - uses: actions/checkout@v2

      - name: kill-process-test-windows
        shell: pwsh
        run: |
          cargo install --path .
          foreman --version
          $env:Path += '%USERPROFILE%/.foreman/bin' 
          .\scripts\kill-process-test-windows.ps1