mirror of
https://github.com/openharmony/third_party_rust_pin-project-lite.git
synced 2026-07-01 20:44:14 -04:00
93 lines
2.8 KiB
YAML
93 lines
2.8 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
- staging
|
|
- trying
|
|
schedule:
|
|
- cron: 00 01 * * 00 # Weekly
|
|
|
|
jobs:
|
|
test:
|
|
name: test
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTFLAGS: -Dwarnings
|
|
strategy:
|
|
matrix:
|
|
build:
|
|
# This is the minimum supported Rust version of this crate.
|
|
# When updating this, the reminder to update the minimum supported
|
|
# Rust version in README.md.
|
|
- 1.37.0
|
|
- stable
|
|
- beta
|
|
- nightly
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust
|
|
run: |
|
|
rustup self update # TODO: when default rustup is bumped to 1.20+, remove this.
|
|
rustup set profile minimal
|
|
rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
|
|
- name: cargo test
|
|
run: |
|
|
cargo test --all
|
|
# Refs: https://github.com/rust-lang/cargo/issues/5657
|
|
- name: cargo check -Zminimal-versions
|
|
if: matrix.rust == 'nightly'
|
|
run: |
|
|
cargo update -Zminimal-versions
|
|
cargo check --all --all-features
|
|
|
|
style:
|
|
name: style
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTFLAGS: -Dwarnings
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
component:
|
|
- clippy
|
|
- rustfmt
|
|
- rustdoc
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust
|
|
run: |
|
|
rustup self update # TODO: when default rustup is bumped to 1.20+, remove this.
|
|
rustup set profile minimal
|
|
rustup update nightly && rustup default nightly
|
|
- name: Install component
|
|
if: matrix.component != 'rustdoc'
|
|
run: |
|
|
if ! rustup component add ${{ matrix.component }}; then
|
|
# If the component is unavailable on the latest nightly,
|
|
# use the latest toolchain with the component available.
|
|
# Refs: https://github.com/rust-lang/rustup-components-history#the-web-part
|
|
component=${{ matrix.component }}
|
|
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/$component`
|
|
echo "'$component' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead"
|
|
rustup toolchain install nightly-$target
|
|
rustup default nightly-$target
|
|
rustup component add $component
|
|
fi
|
|
- name: cargo clippy
|
|
if: matrix.component == 'clippy'
|
|
run: |
|
|
cargo clippy --all --all-features
|
|
- name: cargo fmt -- --check
|
|
if: matrix.component == 'rustfmt'
|
|
run: |
|
|
cargo fmt --all -- --check
|
|
- name: cargo doc
|
|
if: matrix.component == 'rustdoc'
|
|
run: |
|
|
cargo doc --no-deps --all --all-features
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|