From 219a965656cf011c6a31a4bd674352783ba8f230 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 8 Jan 2022 22:35:02 +0900 Subject: [PATCH] Clean up CI config --- .clippy.toml | 1 + .github/workflows/build-and-test.yaml | 44 ----------------- .github/workflows/ci.yml | 71 +++++++++++++++++++++++++++ .github/workflows/lint.yaml | 23 --------- .github/workflows/security.yaml | 17 ------- Cargo.toml | 2 + README.md | 1 - 7 files changed, 74 insertions(+), 85 deletions(-) create mode 100644 .clippy.toml delete mode 100644 .github/workflows/build-and-test.yaml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/lint.yaml delete mode 100644 .github/workflows/security.yaml diff --git a/.clippy.toml b/.clippy.toml new file mode 100644 index 0000000..0f404fa --- /dev/null +++ b/.clippy.toml @@ -0,0 +1 @@ +msrv = "1.40" diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml deleted file mode 100644 index d86beba..0000000 --- a/.github/workflows/build-and-test.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build and test - -on: - push: - branches: - - master - pull_request: - -jobs: - build_and_test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - # 1.40.0 is a MSRV - rust: [1.40.0, nightly, beta, stable] - steps: - - uses: actions/checkout@v2 - - - name: Install latest ${{ matrix.rust }} - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - profile: minimal - override: true - - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --benches --bins --examples --tests --all-features - - - name: Run cargo check (without dev-dependencies to catch missing feature flags) - if: startsWith(matrix.rust, 'nightly') - uses: actions-rs/cargo@v1 - with: - command: check - args: -Z features=dev_dep - - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ee628d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + RUSTFLAGS: -D warnings + RUST_BACKTRACE: 1 + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + rust: [nightly, beta, stable] + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} + - run: cargo build --all --all-features --all-targets + - name: Run cargo check (without dev-dependencies to catch missing feature flags) + if: startsWith(matrix.rust, 'nightly') + run: cargo check -Z features=dev_dep + - run: cargo test + + msrv: + runs-on: ubuntu-latest + strategy: + matrix: + # When updating this, the reminder to update the minimum supported + # Rust version in Cargo.toml and .clippy.toml. + rust: ['1.40'] + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} + - run: cargo build + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features -- -W clippy::all + + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + - run: cargo fmt --all -- --check + + security_audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index b6017f1..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Lint - -on: - push: - branches: - - master - pull_request: - -jobs: - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features -- -W clippy::all diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml deleted file mode 100644 index c4f7947..0000000 --- a/.github/workflows/security.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Security audit - -on: - push: - branches: - - master - pull_request: - -jobs: - security_audit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 6709b58..ecfea5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ name = "blocking" version = "1.1.0" authors = ["Stjepan Glavina "] edition = "2018" +rust-version = "1.40" description = "A thread pool for isolating blocking I/O in async programs" license = "Apache-2.0 OR MIT" repository = "https://github.com/smol-rs/blocking" @@ -13,6 +14,7 @@ homepage = "https://github.com/smol-rs/blocking" documentation = "https://docs.rs/blocking" keywords = ["async", "file", "stdio", "stdin", "process"] categories = ["asynchronous", "concurrency"] +exclude = ["/.*"] [dependencies] async-channel = "1.4.0" diff --git a/README.md b/README.md index ec26ae4..ba4c570 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Build](https://github.com/smol-rs/blocking/workflows/Build%20and%20test/badge.svg)]( https://github.com/smol-rs/blocking/actions) -![Rustc version](https://img.shields.io/badge/rustc-1.40+-lightgray.svg) [![License](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)]( https://github.com/smol-rs/blocking) [![Cargo](https://img.shields.io/crates/v/blocking.svg)](