mirror of
https://github.com/openharmony/third_party_rust_mio.git
synced 2026-07-01 20:53:59 -04:00
ddb830bf73
Our MSRV too low to support this.
156 lines
4.1 KiB
YAML
156 lines
4.1 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [ "master", "v0.6.x", "v0.7.x" ]
|
|
pull_request:
|
|
branches: [ "master", "v0.6.x", "v0.7.x" ]
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: full
|
|
CI: true
|
|
|
|
permissions:
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
jobs:
|
|
Test:
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- name: Install Cargo-hack
|
|
run: cargo install --debug cargo-hack
|
|
- name: Check all features
|
|
run: cargo hack check --feature-powerset
|
|
- name: Tests
|
|
run: cargo test --all-features
|
|
- name: Tests release build
|
|
run: cargo test --release --all-features
|
|
MinimalVersions:
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
override: true
|
|
- name: Install minimal verions
|
|
run: cargo update -Zminimal-versions
|
|
- name: Tests
|
|
run: cargo test --all-features
|
|
MSRV:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
# NOTE: When updating also update Clippy flags, some are disabled due to
|
|
# MSRV.
|
|
toolchain: 1.46.0
|
|
override: true
|
|
- name: Check
|
|
# We only run check allowing us to use newer features in tests.
|
|
run: cargo check --all-features
|
|
Nightly:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
override: true
|
|
- name: Tests
|
|
run: cargo test --all-features
|
|
Clippy:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: clippy
|
|
- name: Clippy
|
|
# NOTE: `clippy::uninlined-format-args` is enabled due to MSRV.
|
|
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::cognitive-complexity -A clippy::uninlined-format-args
|
|
Docs:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- name: Check docs
|
|
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
|
|
Rustfmt:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt
|
|
- name: Check formatting
|
|
# FIXME: for some reason this doesn't actually check all files.
|
|
# So instead we run `rustfmt` directly on each file.
|
|
#cargo fmt --all -- --check
|
|
run: find src tests examples -type f -iname "*.rs" | xargs rustfmt --check
|
|
CheckTargets:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: clippy
|
|
- name: Install all targets
|
|
run: make install_targets
|
|
- name: Install Cargo-hack
|
|
run: cargo install --debug cargo-hack
|
|
- name: Check all targets
|
|
run: make check_all_targets
|
|
# Single job required to merge the pr.
|
|
Passed:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- Test
|
|
- MinimalVersions
|
|
- MSRV
|
|
- Nightly
|
|
- Clippy
|
|
- Docs
|
|
- Rustfmt
|
|
- CheckTargets
|
|
steps:
|
|
- run: exit 0
|