setup-rust-action/.github/workflows/test.yml

45 lines
1.4 KiB
YAML
Raw Normal View History

name: Test
2019-08-21 22:59:24 +00:00
on:
push:
branches: '*'
2019-08-21 22:59:24 +00:00
schedule:
2019-09-04 10:58:20 +00:00
- cron: '0 0 * * *'
2019-08-15 17:29:30 +00:00
jobs:
setup:
2019-08-15 17:29:30 +00:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
2019-08-16 00:16:04 +00:00
rust: [stable, nightly]
2019-09-04 10:58:20 +00:00
include:
- os: macOS-latest
rust: stable
components: rustfmt, clippy
targets: x86_64-apple-darwin
2019-09-18 15:15:56 +00:00
- os: windows-latest
rust: stable
components: rustfmt, clippy
targets: x86_64-pc-windows-msvc
2019-09-18 15:15:56 +00:00
- os: ubuntu-latest
rust: stable
components: rustfmt, clippy
targets: x86_64-unknown-linux-musl
2019-08-15 17:29:30 +00:00
steps:
- uses: hecrj/setup-rust-action@use-bash
2019-08-15 23:56:39 +00:00
with:
rust-version: ${{ matrix.rust }}
2019-09-04 10:58:20 +00:00
components: ${{ matrix.components || '' }}
2019-09-18 15:15:56 +00:00
targets: ${{ matrix.targets || '' }}
- name: Check cargo availability
2019-08-15 17:29:30 +00:00
run: cargo --version
- name: Check rustup default toolchain
2019-08-15 23:56:39 +00:00
run: rustup default | grep '${{ matrix.rust }}'
2019-09-04 10:58:20 +00:00
- name: Check rustfmt and clippy are available on MacOS
if: matrix.os == 'macOS-latest' && matrix.rust == 'stable'
run: |
cargo fmt --version
cargo clippy --version
2019-09-18 15:40:33 +00:00
- name: Check targets are installed correctly
if: matrix.rust == 'stable'
run: rustup target list --installed | grep '${{ matrix.targets }}'