Skip to content

Commit

Permalink
Merge #886
Browse files Browse the repository at this point in the history
886: Clean up CI config r=taiki-e a=taiki-e

- Use dtolnay/rust-toolchain action
- Use cargo-minimal-versions to minimal versions check
- Add macOS to CI (x86_64 and aarch64)
- Fix CachePadded doctest on arm

Closes #642
Fixes #668

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e committed Jul 23, 2022
2 parents 361deed + 3d5f8f8 commit 7181f02
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 43 deletions.
21 changes: 20 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: '10'

test_task:
linux_task:
name: test (aarch64-unknown-linux-gnu)
env:
TARGET: aarch64-unknown-linux-gnu
Expand All @@ -18,3 +18,22 @@ test_task:
test_script:
- cargo test --all --all-features --exclude benchmarks -- --test-threads=1
- cargo test --all --all-features --exclude benchmarks --release -- --test-threads=1

macos_task:
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
matrix:
- name: test (aarch64-apple-darwin)
env:
TARGET: aarch64-apple-darwin
- name: test (x86_64-apple-darwin)
env:
TARGET: x86_64-apple-darwin
setup_script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain nightly
- source $HOME/.cargo/env
- rustup toolchain add nightly-$TARGET && rustup default nightly-$TARGET
test_script:
- source $HOME/.cargo/env
- cargo test --all --all-features --exclude benchmarks -- --test-threads=1
- cargo test --all --all-features --exclude benchmarks --release -- --test-threads=1
2 changes: 2 additions & 0 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
status = [
"ci",
"test (aarch64-unknown-linux-gnu)",
"test (aarch64-apple-darwin)",
"test (x86_64-apple-darwin)",
]
45 changes: 18 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# aarch64/x86_64 macOS and aarch64 linux are tested on Cirrus CI
include:
- rust: '1.38'
os: ubuntu-latest
Expand All @@ -45,27 +46,21 @@ jobs:
os: windows-latest
- rust: nightly
os: ubuntu-latest
# TODO: https://github.com/crossbeam-rs/crossbeam/pull/518#issuecomment-633342606
# - rust: nightly
# os: macos-latest
- rust: nightly
os: windows-latest
- rust: nightly
os: ubuntu-latest
target: i686-unknown-linux-gnu
- rust: nightly
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
# Test 32-bit target that does not have AtomicU64/AtomicI64.
- rust: nightly
os: ubuntu-latest
target: mips-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Install cross
uses: taiki-e/install-action@cross
if: matrix.target != ''
Expand All @@ -85,8 +80,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Check features
Expand All @@ -97,10 +93,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions
- name: dependency tree check
run: ./ci/dependencies.sh

Expand All @@ -112,8 +109,7 @@ jobs:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- uses: dtolnay/rust-toolchain@nightly
- run: ci/no_atomic.sh
- run: git add -N . && git diff --exit-code
if: github.repository_owner != 'crossbeam-rs' || github.event_name != 'schedule'
Expand Down Expand Up @@ -145,8 +141,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- uses: dtolnay/rust-toolchain@stable
- name: rustfmt
run: ./ci/rustfmt.sh

Expand All @@ -155,8 +150,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- uses: dtolnay/rust-toolchain@stable
- name: clippy
run: ./ci/clippy.sh

Expand All @@ -165,8 +159,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup toolchain install nightly --component miri && rustup default nightly
- uses: dtolnay/rust-toolchain@miri
- name: miri
run: ./ci/miri.sh

Expand All @@ -175,8 +168,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- uses: dtolnay/rust-toolchain@nightly
- name: Run sanitizers
run: ./ci/san.sh

Expand All @@ -185,8 +177,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- uses: dtolnay/rust-toolchain@stable
- name: loom
run: ./ci/crossbeam-epoch-loom.sh

Expand All @@ -195,8 +186,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- uses: dtolnay/rust-toolchain@nightly
- name: docs
run: ./ci/docs.sh

Expand Down Expand Up @@ -228,6 +218,7 @@ jobs:
- san
- loom
- docs
- shellcheck
runs-on: ubuntu-latest
steps:
- name: Mark the job as a success
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
- crossbeam-[0-9]+.*
- crossbeam-[a-z]+-[0-9]+.*

env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1

defaults:
run:
shell: bash
Expand Down
8 changes: 1 addition & 7 deletions ci/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,4 @@ cargo tree
cargo tree --duplicate

# Check minimal versions.
# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
# from determining minimal versions based on dev-dependencies.
cargo hack --remove-dev-deps --workspace
# Update Cargo.lock to minimal version dependencies.
cargo update -Zminimal-versions
cargo tree
cargo hack check --all --all-features --exclude benchmarks
cargo minimal-versions build --workspace --all-features --exclude benchmarks
2 changes: 1 addition & 1 deletion ci/rustfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ cd "$(dirname "$0")"/..

rustup component add rustfmt

cargo fmt --all -- --check
cargo fmt --all --check
6 changes: 3 additions & 3 deletions crossbeam-utils/src/cache_padded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use core::ops::{Deref, DerefMut};
/// let addr1 = &*array[0] as *const i8 as usize;
/// let addr2 = &*array[1] as *const i8 as usize;
///
/// assert!(addr2 - addr1 >= 64);
/// assert_eq!(addr1 % 64, 0);
/// assert_eq!(addr2 % 64, 0);
/// assert!(addr2 - addr1 >= 32);
/// assert_eq!(addr1 % 32, 0);
/// assert_eq!(addr2 % 32, 0);
/// ```
///
/// When building a concurrent queue with a head and a tail index, it is wise to place them in
Expand Down

0 comments on commit 7181f02

Please sign in to comment.