name: Test on: push: branches: '*' schedule: - cron: '0 0 * * *' jobs: setup: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] rust: [stable, nightly] include: - os: macOS-latest rust: stable components: rustfmt, clippy targets: x86_64-apple-darwin - os: windows-latest rust: stable components: rustfmt, clippy targets: x86_64-pc-windows-msvc - os: ubuntu-latest rust: stable components: rustfmt, clippy targets: x86_64-unknown-linux-musl steps: - uses: hecrj/setup-rust-action@use-bash with: rust-version: ${{ matrix.rust }} components: ${{ matrix.components || '' }} targets: ${{ matrix.targets || '' }} - name: Check cargo availability run: cargo --version - name: Check rustup default toolchain run: rustup default | grep '${{ matrix.rust }}' - name: Check rustfmt and clippy are available on MacOS if: matrix.os == 'macOS-latest' && matrix.rust == 'stable' run: | cargo fmt --version cargo clippy --version - name: Check targets are installed correctly if: matrix.rust == 'stable' run: rustup target list --installed | grep '${{ matrix.targets }}'