2019-09-13 05:33:33 +10:00
|
|
|
name: Crossterm Test
|
|
|
|
|
|
|
|
on:
|
2019-10-19 08:06:02 +11:00
|
|
|
# Build master branch only
|
2019-09-13 05:33:33 +10:00
|
|
|
push:
|
|
|
|
branches:
|
2019-10-19 07:48:35 +11:00
|
|
|
- master
|
|
|
|
# Build pull requests targeting master branch only
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
2019-09-13 05:33:33 +10:00
|
|
|
jobs:
|
2019-10-19 07:48:35 +11:00
|
|
|
test:
|
2019-10-19 08:09:12 +11:00
|
|
|
name: ${{matrix.rust}} on ${{ matrix.os }}
|
2019-09-13 05:33:33 +10:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-10-19 07:48:35 +11:00
|
|
|
os: [ubuntu-latest, windows-2019, macOS-latest]
|
2019-09-13 05:33:33 +10:00
|
|
|
rust: [stable, nightly]
|
2019-10-19 08:06:02 +11:00
|
|
|
# Allow failures on nightly, it's just informative
|
2019-10-19 07:48:35 +11:00
|
|
|
include:
|
|
|
|
- rust: stable
|
|
|
|
can-fail: false
|
|
|
|
- rust: nightly
|
|
|
|
can-fail: true
|
2019-09-13 05:33:33 +10:00
|
|
|
steps:
|
2019-10-19 07:48:35 +11:00
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v1
|
2019-10-19 07:49:30 +11:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2019-10-19 07:48:35 +11:00
|
|
|
- name: Install Rust
|
|
|
|
uses: hecrj/setup-rust-action@master
|
2019-09-13 05:33:33 +10:00
|
|
|
with:
|
|
|
|
rust-version: ${{ matrix.rust }}
|
2019-10-19 07:48:35 +11:00
|
|
|
components: rustfmt
|
|
|
|
- name: Toolchain Information
|
|
|
|
run: |
|
|
|
|
rustc --version
|
|
|
|
rustfmt --version
|
|
|
|
rustup --version
|
|
|
|
cargo --version
|
|
|
|
- name: Check Formatting
|
|
|
|
if: matrix.rust == 'stable'
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
|
|
|
- name: Test Build
|
2019-09-13 05:33:33 +10:00
|
|
|
run: cargo build
|
2019-10-19 07:48:35 +11:00
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
2019-10-23 01:33:38 +11:00
|
|
|
- name: Test all features
|
2019-10-19 07:48:35 +11:00
|
|
|
run: cargo test --all-features -- --nocapture --test-threads 1
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
2019-10-23 01:33:38 +11:00
|
|
|
- name: Test cursor Feature
|
|
|
|
run: cargo test --features cursor -- --nocapture --test-threads 1
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
|
|
|
- name: Test style Feature
|
|
|
|
run: cargo test --features style -- --nocapture --test-threads 1
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
|
|
|
- name: Test terminal Feature
|
|
|
|
run: cargo test --features terminal -- --nocapture --test-threads 1
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
|
|
|
- name: Test screen Feature
|
|
|
|
run: cargo test --features screen -- --nocapture --test-threads 1
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
|
|
|
- name: Test input Feature
|
|
|
|
run: cargo test --features input -- --nocapture --test-threads 1
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|
2019-10-19 08:06:35 +11:00
|
|
|
- name: Test Packaging
|
|
|
|
if: matrix.rust == 'stable'
|
|
|
|
run: cargo package
|
|
|
|
continue-on-error: ${{ matrix.can-fail }}
|