aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-11-18 15:37:31 -0800
committerHaibo Huang <hhb@google.com>2020-11-18 15:37:31 -0800
commit6c94c6bafeee5322a4502f48fd53bf0269f144cc (patch)
tree62e1173064643de076d5710596b3cd6d390f4d00 /.github/workflows/ci.yml
parentcd6b1713c13e53065c66512d3ba0a578bbf22830 (diff)
downloadpin-project-6c94c6bafeee5322a4502f48fd53bf0269f144cc.tar.gz
Upgrade rust/crates/pin-project to 1.0.2
Test: make Change-Id: Ia85e48e7fd669c568d9abc6a68934b8cfdb13f09
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml118
1 files changed, 50 insertions, 68 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8a7da1d..6932c06 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,12 +6,12 @@ on:
branches:
- master
- staging
- - trying
schedule:
- cron: '0 1 * * *'
env:
- RUSTFLAGS: -Dwarnings
+ CARGO_INCREMENTAL: 0
+ RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
defaults:
@@ -20,7 +20,6 @@ defaults:
jobs:
test:
- name: test
strategy:
matrix:
rust:
@@ -40,99 +39,82 @@ jobs:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v2
- - name: Install Rust
- run: ci/install-rust.sh ${{ matrix.rust }}
- - name: Install cargo-hack
- if: matrix.rust == 'nightly'
- run: |
- cargo install cargo-hack
- - name: Add targets
- if: matrix.rust == 'nightly'
- run: |
- rustup target add thumbv7m-none-eabi
- - name: cargo test
- run: |
- cargo test --all --all-features --exclude expandtest
- - name: cargo check (no-std)
- if: matrix.rust == 'nightly'
- run: |
- cargo check --target thumbv7m-none-eabi --manifest-path tests/no-std/Cargo.toml
- cargo check --target thumbv7m-none-eabi --manifest-path tests/rust-2015/Cargo.toml
- - name: cargo check (minimal versions)
- if: matrix.rust == 'nightly'
- run: |
- bash scripts/check-minimal-versions.sh
+ - uses: taiki-e/github-actions/install-rust@main
+ with:
+ toolchain: ${{ matrix.rust }}
+ - if: startsWith(matrix.rust, 'nightly')
+ run: cargo install cargo-hack
+ - run: rustup target add thumbv7m-none-eabi
+ - run: cargo test --all --all-features --exclude expandtest
+ - run: cargo check --manifest-path tests/no-std/Cargo.toml --target thumbv7m-none-eabi
+ - run: cargo check --manifest-path tests/rust-2015/Cargo.toml --target thumbv7m-none-eabi
+ - if: startsWith(matrix.rust, 'nightly')
+ run: bash scripts/check-minimal-versions.sh
expandtest:
- name: expandtest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Install Rust and Rustfmt
- run: ci/install-component.sh rustfmt
- - name: Install cargo-expand
+ - uses: taiki-e/github-actions/install-rust@main
+ with:
+ component: rustfmt
+ - name: Fetch latest release version of cargo-expand
run: |
- cargo install cargo-expand
- - name: cargo test (expandtest)
- run: |
- bash scripts/expandtest.sh
+ mkdir -p .github/caching
+ curl -LsSf https://api.github.com/repos/dtolnay/cargo-expand/releases/latest | jq -r '.name' > .github/caching/cargo-expand.lock
+ - name: Cache cargo-expand
+ id: cache-cargo-expand
+ uses: actions/cache@v2
+ with:
+ path: ${{ runner.tool_cache }}/cargo-expand/bin
+ key: cargo-expand-bin-${{ hashFiles('.github/caching/cargo-expand.lock') }}
+ - name: Install cargo-expand
+ if: steps.cache-cargo-expand.outputs.cache-hit != 'true'
+ run: cargo install -f cargo-expand --root ${{ runner.tool_cache }}/cargo-expand
+ - run: echo "${{ runner.tool_cache }}/cargo-expand/bin" >> "${GITHUB_PATH}"
+ - run: cargo test -p expandtest
miri:
- name: miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Install Rust and Miri
- run: |
- ci/install-component.sh miri
- cargo miri setup
- - name: cargo miri test
- run: |
- cargo miri test
+ - uses: taiki-e/github-actions/install-rust@main
+ with:
+ component: miri
+ - run: cargo miri test
clippy:
- name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Install Rust and Clippy
- run: ci/install-component.sh clippy
- - name: cargo clippy
- run: |
- cargo clippy --all --all-features --all-targets
+ - uses: taiki-e/github-actions/install-rust@main
+ with:
+ component: clippy
+ - run: cargo clippy --all --all-features --all-targets
rustfmt:
- name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Install Rust and Rustfmt
- run: ci/install-component.sh rustfmt
- - name: cargo fmt --check
- run: |
- cargo fmt --all -- --check
+ - uses: taiki-e/github-actions/install-rust@main
+ with:
+ component: rustfmt
+ - run: cargo fmt --all -- --check
rustdoc:
- name: rustdoc
env:
- RUSTDOCFLAGS: -Dwarnings
+ RUSTDOCFLAGS: -D warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Install Rust
- run: ci/install-rust.sh
- - name: cargo doc
- run: |
- cargo doc --no-deps --all --all-features
+ - uses: taiki-e/github-actions/install-rust@main
+ - run: cargo doc --no-deps --all --all-features
shellcheck:
- name: shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: shellcheck
- run: |
- shellcheck ci/*.sh scripts/*.sh
+ - run: shellcheck **/*.sh
# These jobs don't actually test anything, but they're used to tell bors the
# build completed, as there is no practical way to detect when a workflow is
@@ -145,11 +127,11 @@ jobs:
if: github.event_name == 'push' && success()
needs:
- test
+ - expandtest
+ - miri
- clippy
- rustfmt
- rustdoc
- - expandtest
- - miri
- shellcheck
runs-on: ubuntu-latest
steps:
@@ -160,11 +142,11 @@ jobs:
if: github.event_name == 'push' && !success()
needs:
- test
+ - expandtest
+ - miri
- clippy
- rustfmt
- rustdoc
- - expandtest
- - miri
- shellcheck
runs-on: ubuntu-latest
steps: