Skip to content

Commit

Permalink
Clean up CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Dec 31, 2021
1 parent d0832b0 commit 0ba054e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 105 deletions.
46 changes: 14 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
branches:
- main
- dev
- staging
- v[0-9]+.[0-9]+
schedule:
Expand Down Expand Up @@ -45,43 +46,22 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
component: rustfmt,rust-src
- name: Pre Cache cargo-expand
run: |
mkdir -p .github/caching
curl -fsSL --retry 3 https://api.github.com/repos/dtolnay/cargo-expand/releases/latest \
| jq -r '.tag_name' > .github/caching/cargo-expand.lock
echo "${{ runner.tool_cache }}/cargo-expand/bin" >> "${GITHUB_PATH}"
target: thumbv7m-none-eabi
- uses: dtolnay/install@cargo-expand
if: startsWith(matrix.rust, 'nightly')
- 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') }}
if: startsWith(matrix.rust, 'nightly')
- name: Install cargo-expand
run: cargo install -f cargo-expand --debug --root ${{ runner.tool_cache }}/cargo-expand
if: startsWith(matrix.rust, 'nightly') && steps.cache-cargo-expand.outputs.cache-hit != 'true'
- run: rustup target add thumbv7m-none-eabi
- run: cargo test --all --all-features
- run: cargo build --manifest-path tests/no-std/Cargo.toml --target thumbv7m-none-eabi
- run: cargo build --manifest-path tests/rust-2015/Cargo.toml --target thumbv7m-none-eabi

build:
strategy:
matrix:
range:
# 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, Cargo.toml, and .clippy.toml.
- 1.37..
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- run: cargo install cargo-hack --debug
- run: cargo hack build --all --ignore-private --no-dev-deps --version-range ${{ matrix.range }} --version-step 2
- uses: taiki-e/github-actions/install-rust@main
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack build --workspace --ignore-private --no-dev-deps --version-range .. --version-step 2

miri:
runs-on: ubuntu-latest
Expand All @@ -92,7 +72,7 @@ jobs:
- uses: taiki-e/github-actions/install-rust@main
with:
component: miri
- run: cargo miri test
- run: cargo miri test --workspace
env:
MIRIFLAGS: -Zmiri-tag-raw-pointers

Expand All @@ -105,14 +85,16 @@ jobs:
- uses: taiki-e/github-actions/install-rust@main
with:
component: clippy,rustfmt
- run: cargo install cargo-hack --debug
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- uses: taiki-e/install-action@shellcheck
- run: cargo fmt --all -- --check
if: always()
- run: cargo clippy --all --all-features --all-targets
- run: cargo clippy --workspace --all-features --all-targets
if: always()
- run: tools/check-minimal-versions.sh
- run: cargo minimal-versions build --workspace --all-features --ignore-private
if: always()
- run: shellcheck **/*.sh
- run: shellcheck $(git ls-files '*.sh')
if: always()

docs:
Expand All @@ -122,7 +104,7 @@ jobs:
with:
persist-credentials: false
- uses: taiki-e/github-actions/install-rust@main
- run: cargo doc --no-deps --all --all-features
- run: cargo doc --workspace --all-features
env:
RUSTDOCFLAGS: -D warnings

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: stable
- run: cargo build --all
- run: cargo build --workspace
- uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
Expand Down
72 changes: 0 additions & 72 deletions tools/check-minimal-versions.sh

This file was deleted.

0 comments on commit 0ba054e

Please sign in to comment.