name: CI
on:
  # Trigger the workflow on push or pull request,
  # but only for the master branch
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        build: [linux, macos, windows]
        include:
          - build: linux
            os: ubuntu-latest
          - build: macos
            os: macos-latest
          - build: windows
            os: windows-latest
    steps:
      - uses: actions/checkout@v1
      - name: Cache CARGO_HOME
        uses: actions/cache@v1
        with:
          path: ~/.cargo
          key: ${{ runner.os }}-cargo-home
      - name: Install Rust
        shell: bash
        run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
          sh -s -- -y --default-toolchain=none --profile=minimal
          export PATH="$HOME/.cargo/bin:$PATH"
          rustup override set stable
          # FIXME: Do not update it unless we want Rust newer features
          #rustup update --no-self-update stable
          echo "##[add-path]$HOME/.cargo/bin"
      - run: cargo build
      # FIXME: Cannot access /dev/stderr on Linux/macOs in Actions
      - if: runner.os == 'Windows'
        run: cargo test
      # FIXME: The install-upgrade feature only exit on Rust 1.41.0
      #- shell: bash
      #  run: |
      #    cargo install --debug --no-default-features \
      #      --features ci-autoclean --bin cargo-cache \
      #      --git https://github.com/matthiaskrgr/cargo-cache -- cargo-cache
      #    cargo cache

name: CI
on:
  # Trigger the workflow on push or pull request,
  # but only for the master branch
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        build: [linux, macos, windows]
        include:
          - build: linux
            os: ubuntu-latest
          - build: macos
            os: macos-latest
          - build: windows
            os: windows-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable

      - uses: actions-rs/cargo@v1
        with:
          command: build


Update and fix github CI
Update and fix github CI
