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

ci: Use reusable workflows for fmt and security_audit #77

Merged
merged 2 commits into from
Jan 19, 2025
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
38 changes: 12 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ defaults:
shell: bash

jobs:
fmt:
uses: smol-rs/.github/.github/workflows/fmt.yml@main
security_audit:
uses: smol-rs/.github/.github/workflows/security_audit.yml@main
permissions:
checks: write
contents: read
issues: write
secrets: inherit

test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -77,14 +87,6 @@ jobs:
run: rustup update stable
- run: cargo clippy --all-features --all-targets

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all --check

miri:
runs-on: ubuntu-latest
steps:
Expand All @@ -103,28 +105,12 @@ jobs:
- name: Install Rust
run: rustup update stable
- name: Loom tests
run: cargo test --release --test loom --features loom
run: cargo test --release --test loom --features loom
env:
RUSTFLAGS: "--cfg=loom"
LOOM_MAX_PREEMPTIONS: 4
- name: Loom tests without default features
run: cargo test --release --test loom --features loom --no-default-features
run: cargo test --release --test loom --features loom --no-default-features
env:
RUSTFLAGS: "--cfg=loom"
LOOM_MAX_PREEMPTIONS: 4

security_audit:
permissions:
checks: write
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# rustsec/audit-check used to do this automatically
- name: Generate Cargo.lock
run: cargo generate-lockfile
# https://github.com/rustsec/audit-check/issues/2
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion src/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl<T> Bounded<T> {
let slot = &self.buffer[index];
let stamp = slot.stamp.load(Ordering::Acquire);

// If the the stamp is ahead of the head by 1, we may attempt to pop.
// If the stamp is ahead of the head by 1, we may attempt to pop.
if head + 1 == stamp {
let new = if index + 1 < self.buffer.len() {
// Same lap, incremented index.
Expand Down
Loading