Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize CI somewhat #8

Merged
merged 8 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'

env:
RUST_BACKTRACE: 1
Expand All @@ -19,16 +17,16 @@ jobs:
fail-fast: false
matrix:
include:
- { rust: 1.46.0, os: ubuntu-latest }
- { rust: 1.60.0, os: ubuntu-latest }
- { rust: stable, os: ubuntu-latest }
- { rust: stable, os: macos-latest }
- { rust: stable, os: windows-latest }
- { rust: stable-i686-msvc, os: windows-latest }
- { rust: beta, os: ubuntu-latest }
- { rust: nightly, os: ubuntu-latest }
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
- run: cargo test --verbose --workspace --all-features
Expand All @@ -47,12 +45,12 @@ jobs:
target:
- i686-unknown-linux-gnu
- armv7-linux-androideabi
- aarch64-linux-android
- mips-unknown-linux-gnu
- mips64-unknown-linux-gnuabi64
- aarch64-unknown-linux-gnu
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v2
- run: cargo install cross
- run: cross test --verbose --target=${{ matrix.target }} --no-default-features
- run: cross test --verbose --target=${{ matrix.target }} --all-features
Expand All @@ -63,30 +61,28 @@ jobs:
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v2
- run: cargo check --workspace --all-targets --verbose
- run: cargo check --workspace --all-targets --verbose --no-default-features

rustfmt:
name: Verify code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v2
with:
components: rustfmt
- run: cargo fmt --all -- --check

codecov-tarpaulin:
name: Generate code coverage
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- uses: actions-rs/[email protected]
with:
args: --all-features --doc
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
- uses: actions/checkout@v3
- run: cargo tarpaulin --verbose --doc --all-features --all-targets --engine llvm --out xml
- uses: codecov/codecov-action@v4
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "atomic_float"
version = "0.1.0"
authors = ["Thom Chiovoloni <[email protected]>"]
edition = "2018"
edition = "2021"
rust-version = "1.60.0"
license = "Apache-2.0 OR MIT OR Zlib"
readme = "README.md"
description = "Floating point types which can be safely shared between threads"
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ pub use atomic_f32::AtomicF32;

#[cfg(all(
feature = "atomic_f64",
not(any(target_arch = "powerpc", target_arch = "mips", force_disable_atomic64))
target_has_atomic = "64",
not(force_disable_atomic64),
))]
mod atomic_f64;

#[cfg(all(
feature = "atomic_f64",
not(any(target_arch = "powerpc", target_arch = "mips", force_disable_atomic64))
target_has_atomic = "64",
not(force_disable_atomic64),
))]
pub use atomic_f64::AtomicF64;

Expand Down
7 changes: 6 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ fn test_serde_f32() {
);
}

#[cfg(all(feature = "serde", feature = "atomic_f64"))]
#[cfg(all(
feature = "serde",
feature = "atomic_f64",
target_has_atomic = "64",
not(force_disable_atomic64),
))]
#[test]
fn test_serde_f64() {
serde_test::assert_tokens(
Expand Down
Loading