| 1 |
name: Crossterm Test |
| 2 |
|
| 3 |
on: |
| 4 |
# Build master branch only |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- master |
| 8 |
# Build pull requests targeting master branch only |
| 9 |
pull_request: |
| 10 |
branches: |
| 11 |
- master |
| 12 |
|
| 13 |
jobs: |
| 14 |
test: |
| 15 |
name: ${{matrix.rust}} on ${{ matrix.os }} |
| 16 |
runs-on: ${{ matrix.os }} |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
os: [ubuntu-latest, windows-2019, macOS-latest] |
| 20 |
rust: [stable, nightly] |
| 21 |
# Allow failures on nightly, it's just informative |
| 22 |
include: |
| 23 |
- rust: stable |
| 24 |
can-fail: false |
| 25 |
- rust: nightly |
| 26 |
can-fail: true |
| 27 |
steps: |
| 28 |
- name: Checkout Repository |
| 29 |
uses: actions/checkout@v1 |
| 30 |
with: |
| 31 |
fetch-depth: 1 |
| 32 |
- name: Install Rust |
| 33 |
uses: hecrj/setup-rust-action@master |
| 34 |
with: |
| 35 |
rust-version: ${{ matrix.rust }} |
| 36 |
components: rustfmt,clippy |
| 37 |
- name: Toolchain Information |
| 38 |
run: | |
| 39 |
rustc --version |
| 40 |
rustfmt --version |
| 41 |
rustup --version |
| 42 |
cargo --version |
| 43 |
- name: Check Formatting |
| 44 |
if: matrix.rust == 'stable' |
| 45 |
run: cargo fmt --all -- --check |
| 46 |
continue-on-error: ${{ matrix.can-fail }} |
| 47 |
- name: Clippy |
| 48 |
run: cargo clippy --all-features -- -D clippy::all |
| 49 |
continue-on-error: ${{ matrix.can-fail }} |
| 50 |
- name: Test Build |
| 51 |
run: cargo build |
| 52 |
continue-on-error: ${{ matrix.can-fail }} |
| 53 |
- name: Test default features |
| 54 |
run: cargo test --lib -- --nocapture --test-threads 1 |
| 55 |
continue-on-error: ${{ matrix.can-fail }} |
| 56 |
- name: Test serde feature |
| 57 |
run: cargo test --lib --features serde -- --nocapture --test-threads 1 |
| 58 |
continue-on-error: ${{ matrix.can-fail }} |
| 59 |
- name: Test event-stream feature |
| 60 |
run: cargo test --lib --features "event-stream,events" -- --nocapture --test-threads 1 |
| 61 |
continue-on-error: ${{ matrix.can-fail }} |
| 62 |
- name: Test all features |
| 63 |
run: cargo test --all-features -- --nocapture --test-threads 1 |
| 64 |
continue-on-error: ${{ matrix.can-fail }} |
| 65 |
- name: Test no default features |
| 66 |
if: matrix.os != 'windows-2019' |
| 67 |
run: cargo test --no-default-features -- --nocapture --test-threads 1 |
| 68 |
continue-on-error: ${{ matrix.can-fail }} |
| 69 |
- name: Test no default features with use-dev-tty feature enabled |
| 70 |
if: matrix.os != 'windows-2019' |
| 71 |
run: cargo test --no-default-features --features "use-dev-tty events event-stream bracketed-paste" -- --nocapture --test-threads 1 |
| 72 |
continue-on-error: ${{ matrix.can-fail }} |
| 73 |
- name: Test no default features with windows feature enabled |
| 74 |
if: matrix.os == 'windows-2019' |
| 75 |
run: cargo test --no-default-features --features "windows" -- --nocapture --test-threads 1 |
| 76 |
continue-on-error: ${{ matrix.can-fail }} |
| 77 |
- name: Test Packaging |
| 78 |
if: matrix.rust == 'stable' |
| 79 |
run: cargo package |
| 80 |
continue-on-error: ${{ matrix.can-fail }} |