diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42888f3d..05e1e24c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,15 @@ name: CI -on: [push, pull_request] +on: + push: + branches: [ master, "v0.3.x" ] + pull_request: + branches: [ master, "v0.3.x" ] env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full jobs: - test: + Test: name: Test runs-on: ${{ matrix.os }} strategy: @@ -32,34 +36,42 @@ jobs: - name: Install Rust (rustup) run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} shell: bash - - run: cargo test - - run: cargo test --features all + - name: Install cargo-hack + run: cargo install cargo-hack + - name: Run tests + run: cargo hack test --feature-powerset && cargo hack test --feature-powerset --release - rustfmt: + Rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Install Rust run: rustup update stable && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check + - name: Check formatting + run: cargo fmt --all -- --check - check: + Check: name: Check runs-on: ubuntu-latest strategy: matrix: - target: [x86_64-unknown-redox, x86_64-fuchsia] + # TODO: add the following targets, currently broken. + # "x86_64-fuchsia" + # "x86_64-unknown-redox" + target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-sun-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu", "x86_64-unknown-netbsd"] steps: - uses: actions/checkout@master - name: Install Rust - run: rustup update nightly && rustup default nightly - - run: rustup target add ${{ matrix.target }} - - run: cargo check --target ${{ matrix.target }} --all-targets --examples --bins --tests --no-default-features - - run: cargo check --target ${{ matrix.target }} --all-targets --examples --bins --tests --all-features - continue-on-error: true + run: rustup update stable && rustup default stable + - name: Install cargo-hack + run: cargo install cargo-hack + - name: Install Target + run: rustup target add ${{ matrix.target }} + - name: Run check + run: cargo hack check --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }} - publish_docs: + Publish_docs: name: Publish Documentation runs-on: ubuntu-latest steps: