From b9d1dbf72cf34d1b8bd28b53c0214ca119fac582 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 6 Jan 2024 19:02:12 +0900 Subject: [PATCH 1/8] ci: Update actions/checkout action to v4 --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f7b1d93..500e4e45b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: name: rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable && rustup default stable - name: Check formatting @@ -35,7 +35,7 @@ jobs: # name: clippy # runs-on: ubuntu-latest # steps: - # - uses: actions/checkout@v3 + # - uses: actions/checkout@v4 # - name: Apply clippy lints # run: cargo clippy --all-features @@ -48,7 +48,7 @@ jobs: name: minrust runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update 1.39.0 && rustup default 1.39.0 - name: Check @@ -65,7 +65,7 @@ jobs: - windows-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. run: rustup update stable --no-self-update && rustup default stable @@ -77,7 +77,7 @@ jobs: name: nightly runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update $nightly && rustup default $nightly - name: Test @@ -96,7 +96,7 @@ jobs: - wasm32-unknown-unknown runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable && rustup default stable - name: cross build --target ${{ matrix.target }} @@ -116,7 +116,7 @@ jobs: name: tsan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update $nightly && rustup default $nightly - name: Install rust-src @@ -127,7 +127,7 @@ jobs: name: miri runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Miri run: ci/miri.sh @@ -136,7 +136,7 @@ jobs: name: loom runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update $nightly && rustup default $nightly - name: Loom tests @@ -155,7 +155,7 @@ jobs: - loom runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update $nightly && rustup default $nightly - name: Build documentation From f4806b84b575aeef886970c39e6625ca9702fa97 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 6 Jan 2024 19:02:57 +0900 Subject: [PATCH 2/8] ci: Run on a regular basis --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 500e4e45b..e59d220d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,8 @@ on: push: branches: - master + schedule: + - cron: '0 2 * * 0' env: RUSTFLAGS: -Dwarnings From 0363d230084eb4237819dea3bedd0adf6e7fd1c6 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 6 Jan 2024 19:04:25 +0900 Subject: [PATCH 3/8] ci: Remove no longer needed argument for cargo fmt --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e59d220d3..62f1d3679 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - name: Install Rust run: rustup update stable && rustup default stable - name: Check formatting - run: cargo fmt --all -- --check + run: cargo fmt --all --check # TODO # # Apply clippy lints From 95d3685c2d9151337f564f4dde7d98d31114958a Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 7 Jan 2024 23:32:58 +0900 Subject: [PATCH 4/8] ci: Remove cargo doc from test-stable.sh doc build is covered by publish_docs job. --- ci/test-stable.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/test-stable.sh b/ci/test-stable.sh index 4421f3a97..025432be8 100644 --- a/ci/test-stable.sh +++ b/ci/test-stable.sh @@ -15,8 +15,6 @@ cargo hack "${cmd}" --each-feature --optional-deps # Run with all features cargo "${cmd}" --all-features -cargo doc --no-deps --all-features - if [[ "${RUST_VERSION}" == "nightly"* ]]; then # Check benchmarks cargo check --benches From 637d0c198476820b0185e7e9597335a43b4a494c Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 7 Jan 2024 23:35:53 +0900 Subject: [PATCH 5/8] ci: Use install-action to install cargo-hack and cross --- .github/workflows/ci.yml | 13 ++++++++++--- ci/test-stable.sh | 4 ---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62f1d3679..f96ad8d4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust run: rustup update 1.39.0 && rustup default 1.39.0 + - name: Install cargo-hack + uses: taiki-e/install-action@cargo-hack - name: Check run: . ci/test-stable.sh check @@ -71,6 +73,8 @@ jobs: - name: Install Rust # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. run: rustup update stable --no-self-update && rustup default stable + - name: Install cargo-hack + uses: taiki-e/install-action@cargo-hack - name: Test run: . ci/test-stable.sh test @@ -82,6 +86,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust run: rustup update $nightly && rustup default $nightly + - name: Install cargo-hack + uses: taiki-e/install-action@cargo-hack - name: Test run: . ci/test-stable.sh test @@ -101,10 +107,11 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable && rustup default stable + - name: Install cross + uses: taiki-e/install-action@cross + if: matrix.target != 'wasm32-unknown-unknown' - name: cross build --target ${{ matrix.target }} - run: | - cargo install cross - cross build --target ${{ matrix.target }} + run: cross build --target ${{ matrix.target }} if: matrix.target != 'wasm32-unknown-unknown' # WASM support - name: cargo build --target ${{ matrix.target }} diff --git a/ci/test-stable.sh b/ci/test-stable.sh index 025432be8..a8eaa3c65 100644 --- a/ci/test-stable.sh +++ b/ci/test-stable.sh @@ -4,10 +4,6 @@ set -ex cmd="${1:-test}" -# Install cargo-hack for feature flag test -host=$(rustc -Vv | grep host | sed 's/host: //') -curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-$host.tar.gz | tar xzf - -C ~/.cargo/bin - # Run with each feature # * --each-feature includes both default/no-default features # * --optional-deps is needed for serde feature From c8278d17c5873d34e0c9d2151aad9b7f6c839e26 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 7 Jan 2024 23:38:14 +0900 Subject: [PATCH 6/8] ci: Make scripts executable --- .github/workflows/ci.yml | 9 +++++---- ci/test-stable.sh | 0 ci/tsan.sh | 0 3 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 ci/test-stable.sh mode change 100644 => 100755 ci/tsan.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f96ad8d4c..5a479278b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - name: Check - run: . ci/test-stable.sh check + run: ci/test-stable.sh check # Stable stable: @@ -76,7 +76,7 @@ jobs: - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - name: Test - run: . ci/test-stable.sh test + run: ci/test-stable.sh test # Nightly nightly: @@ -89,7 +89,7 @@ jobs: - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - name: Test - run: . ci/test-stable.sh test + run: ci/test-stable.sh test # Run tests on some extra platforms cross: @@ -131,7 +131,8 @@ jobs: - name: Install rust-src run: rustup component add rust-src - name: ASAN / TSAN - run: . ci/tsan.sh + run: ci/tsan.sh + miri: name: miri runs-on: ubuntu-latest diff --git a/ci/test-stable.sh b/ci/test-stable.sh old mode 100644 new mode 100755 diff --git a/ci/tsan.sh b/ci/tsan.sh old mode 100644 new mode 100755 From 5062ec665ed846348314df19b7e4d35a064295a4 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 7 Jan 2024 23:43:09 +0900 Subject: [PATCH 7/8] ci: Remove needless commands stable toolchain is already the default. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a479278b..6b2cf2022 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Rust - run: rustup update stable && rustup default stable + run: rustup update stable - name: Check formatting run: cargo fmt --all --check @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. - run: rustup update stable --no-self-update && rustup default stable + run: rustup update stable --no-self-update - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - name: Test @@ -106,7 +106,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Rust - run: rustup update stable && rustup default stable + run: rustup update stable - name: Install cross uses: taiki-e/install-action@cross if: matrix.target != 'wasm32-unknown-unknown' From 07b712913aa25ec6e06b0d206d4c58ce6cf882c5 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 7 Jan 2024 23:48:25 +0900 Subject: [PATCH 8/8] ci: Use cargo-hack's --rust-version flag for minrust job This respects rust-version field in Cargo.toml, so it removes the need to manage MSRV in both the CI file and Cargo.toml. --- .github/workflows/ci.yml | 4 +--- Cargo.toml | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b2cf2022..c0658a142 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,12 +51,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update 1.39.0 && rustup default 1.39.0 - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - name: Check - run: ci/test-stable.sh check + run: cargo hack check --feature-powerset --optional-deps --rust-version # Stable stable: diff --git a/Cargo.toml b/Cargo.toml index 06b19e671..9b1a2278c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,8 @@ name = "bytes" # - Update CHANGELOG.md. # - Create "v1.x.y" git tag. version = "1.5.0" +edition = "2018" +rust-version = "1.39" license = "MIT" authors = [ "Carl Lerche ", @@ -15,7 +17,6 @@ repository = "https://github.com/tokio-rs/bytes" readme = "README.md" keywords = ["buffers", "zero-copy", "io"] categories = ["network-programming", "data-structures"] -edition = "2018" [features] default = ["std"]