nblf-queue 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. nblf_queue-0.1.0/.github/DOCS.md +23 -0
  2. nblf_queue-0.1.0/.github/codecov.yml +21 -0
  3. nblf_queue-0.1.0/.github/dependabot.yml +19 -0
  4. nblf_queue-0.1.0/.github/workflows/check.yml +156 -0
  5. nblf_queue-0.1.0/.github/workflows/nostd.yml +64 -0
  6. nblf_queue-0.1.0/.github/workflows/pypi_release.yml +145 -0
  7. nblf_queue-0.1.0/.github/workflows/safety.yml +108 -0
  8. nblf_queue-0.1.0/.github/workflows/scheduled.yml +62 -0
  9. nblf_queue-0.1.0/.github/workflows/test.yml +220 -0
  10. nblf_queue-0.1.0/.gitignore +14 -0
  11. nblf_queue-0.1.0/.helix/languages.toml +3 -0
  12. nblf_queue-0.1.0/Cargo.lock +1199 -0
  13. nblf_queue-0.1.0/Cargo.toml +127 -0
  14. nblf_queue-0.1.0/LICENSE +21 -0
  15. nblf_queue-0.1.0/PKG-INFO +162 -0
  16. nblf_queue-0.1.0/README.md +148 -0
  17. nblf_queue-0.1.0/benches/README.md +27 -0
  18. nblf_queue-0.1.0/benches/queue_benchmarks.rs +530 -0
  19. nblf_queue-0.1.0/bindings/python/Cargo.toml +25 -0
  20. nblf_queue-0.1.0/bindings/python/README.md +148 -0
  21. nblf_queue-0.1.0/bindings/python/src/lib.rs +248 -0
  22. nblf_queue-0.1.0/docs/nblfq.excalidraw.png +0 -0
  23. nblf_queue-0.1.0/justfile +40 -0
  24. nblf_queue-0.1.0/pyproject.toml +54 -0
  25. nblf_queue-0.1.0/python/nblf_queue/__init__.py +3 -0
  26. nblf_queue-0.1.0/python/nblf_queue/__init__.pyi +183 -0
  27. nblf_queue-0.1.0/python/tests/__init__.py +0 -0
  28. nblf_queue-0.1.0/python/tests/test_bench_nblfq.py +74 -0
  29. nblf_queue-0.1.0/python/tests/test_imports.py +10 -0
  30. nblf_queue-0.1.0/python/tests/test_nblf_queue.py +94 -0
  31. nblf_queue-0.1.0/rustfmt.toml +4 -0
  32. nblf_queue-0.1.0/src/array/buffer.rs +27 -0
  33. nblf_queue-0.1.0/src/array/mod.rs +6 -0
  34. nblf_queue-0.1.0/src/array/queue.rs +156 -0
  35. nblf_queue-0.1.0/src/core/buffer.rs +6 -0
  36. nblf_queue-0.1.0/src/core/mod.rs +75 -0
  37. nblf_queue-0.1.0/src/core/packed.rs +1002 -0
  38. nblf_queue-0.1.0/src/core/queue.rs +200 -0
  39. nblf_queue-0.1.0/src/core/slot.rs +309 -0
  40. nblf_queue-0.1.0/src/growable/mod.rs +22 -0
  41. nblf_queue-0.1.0/src/growable/pooled.rs +94 -0
  42. nblf_queue-0.1.0/src/growable/queue.rs +411 -0
  43. nblf_queue-0.1.0/src/lib.rs +228 -0
  44. nblf_queue-0.1.0/src/owned/buffer.rs +27 -0
  45. nblf_queue-0.1.0/src/owned/mod.rs +5 -0
  46. nblf_queue-0.1.0/src/owned/queue.rs +166 -0
  47. nblf_queue-0.1.0/src/pool.rs +227 -0
  48. nblf_queue-0.1.0/src/sync.rs +77 -0
  49. nblf_queue-0.1.0/src/tests/README.md +33 -0
  50. nblf_queue-0.1.0/src/tests/core.rs +608 -0
  51. nblf_queue-0.1.0/src/tests/loom.rs +116 -0
  52. nblf_queue-0.1.0/src/tests/mod.rs +8 -0
  53. nblf_queue-0.1.0/src/tests/shuttle.rs +933 -0
  54. nblf_queue-0.1.0/src/tests/test_library.rs +852 -0
  55. nblf_queue-0.1.0/src/utils.rs +276 -0
  56. nblf_queue-0.1.0/uv.lock +273 -0
@@ -0,0 +1,23 @@
1
+ # Github config and workflows
2
+
3
+ In this folder there is configuration for codecoverage, dependabot, and ci
4
+ workflows that check the library more deeply than the default configurations.
5
+
6
+ This folder can be or was merged using a --allow-unrelated-histories merge
7
+ strategy from <https://github.com/jonhoo/rust-ci-conf/> which provides a
8
+ reasonably sensible base for writing your own ci on. By using this strategy
9
+ the history of the CI repo is included in your repo, and future updates to
10
+ the CI can be merged later.
11
+
12
+ To perform this merge run:
13
+
14
+ ```shell
15
+ git remote add ci https://github.com/jonhoo/rust-ci-conf.git
16
+ git fetch ci
17
+ git merge --allow-unrelated-histories ci/main
18
+ ```
19
+
20
+ An overview of the files in this project is available at:
21
+ <https://www.youtube.com/watch?v=xUH-4y92jPg&t=491s>, which contains some
22
+ rationale for decisions and runs through an example of solving minimal version
23
+ and OpenSSL issues.
@@ -0,0 +1,21 @@
1
+ # ref: https://docs.codecov.com/docs/codecovyml-reference
2
+ coverage:
3
+ # Hold ourselves to a high bar
4
+ range: 85..100
5
+ round: down
6
+ precision: 1
7
+ status:
8
+ # ref: https://docs.codecov.com/docs/commit-status
9
+ project:
10
+ default:
11
+ # Avoid false negatives
12
+ threshold: 1%
13
+
14
+ # Test files aren't important for coverage
15
+ ignore:
16
+ - "tests"
17
+
18
+ # Make comments less noisy
19
+ comment:
20
+ layout: "files"
21
+ require_changes: true
@@ -0,0 +1,19 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: monthly
7
+ - package-ecosystem: cargo
8
+ directory: /
9
+ schedule:
10
+ interval: daily
11
+ ignore:
12
+ - dependency-name: "*"
13
+ # patch and minor updates don't matter for libraries as consumers of this library build
14
+ # with their own lockfile, rather than the version specified in this library's lockfile
15
+ # remove this ignore rule if your package has binaries to ensure that the binaries are
16
+ # built with the exact set of dependencies and those are up to date.
17
+ update-types:
18
+ - "version-update:semver-patch"
19
+ - "version-update:semver-minor"
@@ -0,0 +1,156 @@
1
+ # This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs
2
+ # several checks:
3
+ # - fmt: checks that the code is formatted according to rustfmt
4
+ # - clippy: checks that the code does not contain any clippy warnings
5
+ # - doc: checks that the code can be documented without errors
6
+ # - hack: check combinations of feature flags
7
+ # - msrv: check that the msrv specified in the crate is correct
8
+ permissions:
9
+ contents: read
10
+ # This configuration allows maintainers of this repo to create a branch and pull request based on
11
+ # the new branch. Restricting the push trigger to the main branch ensures that the PR only gets
12
+ # built once.
13
+ on:
14
+ push:
15
+ branches: [main]
16
+ pull_request:
17
+ # If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
18
+ # we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21
+ cancel-in-progress: true
22
+ name: check
23
+ jobs:
24
+ fmt:
25
+ runs-on: ubuntu-latest
26
+ name: stable / fmt
27
+ steps:
28
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
29
+ with:
30
+ submodules: true
31
+ - name: Install stable
32
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
33
+ with:
34
+ toolchain: nightly
35
+ components: rustfmt
36
+ - name: cargo fmt --check
37
+ run: cargo fmt --check
38
+ clippy:
39
+ runs-on: ubuntu-latest
40
+ name: ${{ matrix.toolchain }} / clippy
41
+ permissions:
42
+ contents: read
43
+ checks: write
44
+ strategy:
45
+ fail-fast: false
46
+ matrix:
47
+ # Get early warning of new lints which are regularly introduced in beta channels.
48
+ toolchain: [stable, beta]
49
+ steps:
50
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
51
+ with:
52
+ submodules: true
53
+ - name: Install ${{ matrix.toolchain }}
54
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
55
+ with:
56
+ toolchain: ${{ matrix.toolchain }}
57
+ components: clippy
58
+ - name: cargo clippy
59
+ uses: giraffate/clippy-action@13b9d32482f25d29ead141b79e7e04e7900281e0 # tag=v1.0.1
60
+ with:
61
+ reporter: 'github-pr-check'
62
+ github_token: ${{ secrets.GITHUB_TOKEN }}
63
+ # TODO add semver back in, once published on crates.io
64
+ semver:
65
+ runs-on: ubuntu-latest
66
+ name: semver
67
+ steps:
68
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
69
+ with:
70
+ submodules: true
71
+ - name: Install stable
72
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
73
+ with:
74
+ toolchain: stable
75
+ components: rustfmt
76
+ - name: cargo-semver-checks
77
+ uses: obi1kenobi/cargo-semver-checks-action@5b298c9520f7096a4683c0bd981a7ac5a7e249ae # tag=v2.8
78
+ doc:
79
+ # run docs generation on nightly rather than stable. This enables features like
80
+ # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an
81
+ # API be documented as only available in some specific platforms.
82
+ runs-on: ubuntu-latest
83
+ name: nightly / doc
84
+ steps:
85
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
86
+ with:
87
+ submodules: true
88
+ - name: Install nightly
89
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
90
+ with:
91
+ toolchain: nightly
92
+ - name: Install cargo-docs-rs
93
+ uses: dtolnay/install@982daea0f5d846abc3c83e01a6a1d73c040047c1 # branch=cargo-docs-rs
94
+ - name: cargo docs-rs
95
+ run: cargo docs-rs
96
+ hack:
97
+ # cargo-hack checks combinations of feature flags to ensure that features are all additive
98
+ # which is required for feature unification
99
+ runs-on: ubuntu-latest
100
+ name: ubuntu / stable / features
101
+ steps:
102
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
103
+ with:
104
+ submodules: true
105
+ - name: Install stable
106
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
107
+ with:
108
+ toolchain: stable
109
+ - name: cargo install cargo-hack
110
+ uses: taiki-e/install-action@e49978b799e49ff429d162b7a30601a569ab6538 # tag=v2.81.1
111
+ with:
112
+ tool: cargo-hack
113
+ # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
114
+ # --feature-powerset runs for every combination of features
115
+ - name: cargo hack
116
+ run: cargo hack --feature-powerset check
117
+ msrv:
118
+ # check that we can build using the minimal rust version that is specified by this crate
119
+ runs-on: ubuntu-latest
120
+ # we use a matrix here just because env can't be used in job names
121
+ # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
122
+ strategy:
123
+ matrix:
124
+ msrv: ["1.85.0"] # 2021 edition requires 1.56
125
+ name: ubuntu / ${{ matrix.msrv }}
126
+ steps:
127
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
128
+ with:
129
+ submodules: true
130
+ - name: Install ${{ matrix.msrv }}
131
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
132
+ with:
133
+ toolchain: ${{ matrix.msrv }}
134
+ - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # tag=v5.0.5
135
+ with:
136
+ path: ~/.cargo
137
+ key: ${{ runner.os }}-cargo
138
+ - name: cargo +${{ matrix.msrv }} check
139
+ run: cargo check
140
+ check-py:
141
+ runs-on: ubuntu-latest
142
+ steps:
143
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # tag=v6.0.3
144
+ with:
145
+ submodules: true
146
+ - name: set up
147
+ uses: actions/setup-python@v6
148
+ - name: Install uv
149
+ uses: astral-sh/setup-uv@v7
150
+ - name: dependencies
151
+ run: uv sync --group dev
152
+ - name: check
153
+ run: |
154
+ uv run ruff check python
155
+ uv run ruff format --check python
156
+ uv run pyright
@@ -0,0 +1,64 @@
1
+ # This workflow checks whether the library is able to run without the std library (e.g., embedded).
2
+ # This entire file should be removed if this crate does not support no-std. See check.yml for
3
+ # information about how the concurrency cancellation and workflow triggering works
4
+ permissions:
5
+ contents: read
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12
+ cancel-in-progress: true
13
+ name: no-std
14
+ jobs:
15
+ nostd_pass:
16
+ runs-on: ubuntu-latest
17
+ name: ${{ matrix.target }}
18
+ strategy:
19
+ matrix:
20
+ target: [aarch64-unknown-none]
21
+ steps:
22
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
23
+ with:
24
+ submodules: true
25
+ - name: Install stable
26
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
27
+ with:
28
+ toolchain: stable
29
+ - name: rustup target add ${{ matrix.target }}
30
+ run: rustup target add ${{ matrix.target }}
31
+ - name: cargo check
32
+ run: cargo check --target ${{ matrix.target }} --no-default-features
33
+ nostd_fail:
34
+ runs-on: ubuntu-latest
35
+ name: ${{ matrix.target }}
36
+ strategy:
37
+ matrix:
38
+ target: [thumbv7m-none-eabi]
39
+ steps:
40
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
41
+ with:
42
+ submodules: true
43
+ - name: Install stable
44
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
45
+ with:
46
+ toolchain: stable
47
+ - name: rustup target add ${{ matrix.target }}
48
+ run: rustup target add ${{ matrix.target }}
49
+ - name: cargo check
50
+ run: cargo check --target ${{ matrix.target }} --no-default-features
51
+ # currently there is no support for this without feature atomic-fallback
52
+ continue-on-error: true
53
+ id: check_result
54
+ - name: verify
55
+ run: |
56
+ if [ "${{ steps.check_result.outcome }}" = "failure" ]; then
57
+ echo "mission failed succesfully"
58
+ exit 0
59
+ else
60
+ echo "no compile err"
61
+ exit 1
62
+ fi
63
+ - name: correct
64
+ run: cargo check --target ${{ matrix.target }} --no-default-features --features atomic-fallback
@@ -0,0 +1,145 @@
1
+ name: Release Python
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ sha:
7
+ description: 'Commit SHA to release (defaults to latest on branch)'
8
+ type: string
9
+ dry-run:
10
+ description: 'Dry run (build everything but do not publish anywhere)'
11
+ type: boolean
12
+ default: false
13
+ testpypi-only:
14
+ description: 'Publish to TestPyPI only (skip production PyPI)'
15
+ type: boolean
16
+ default: false
17
+
18
+ concurrency:
19
+ group: ${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
21
+
22
+ env:
23
+ CARGO_INCREMENTAL: 0
24
+ CARGO_TERM_COLOR: always
25
+ MATURIN_VERSION: 1.9.4
26
+ MATURIN_ARGS: --release
27
+
28
+ defaults:
29
+ run:
30
+ shell: bash
31
+
32
+ jobs:
33
+ create-sdist:
34
+ name: Create Source Distribution
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - uses: actions/checkout@v6
38
+ with:
39
+ ref: ${{ inputs.sha || github.sha }}
40
+
41
+ - uses: actions/setup-python@v6
42
+ with:
43
+ python-version: '3.12'
44
+
45
+ - name: Build sdist
46
+ uses: PyO3/maturin-action@v1
47
+ with:
48
+ command: sdist
49
+ args: --out dist
50
+ maturin-version: ${{ env.MATURIN_VERSION }}
51
+
52
+ - uses: actions/upload-artifact@v6
53
+ with:
54
+ name: python-sdist
55
+ path: dist/*.tar.gz
56
+
57
+ build-wheels:
58
+ name: Build Wheels (${{ matrix.target }})
59
+ runs-on: ${{ matrix.os }}
60
+ strategy:
61
+ fail-fast: false
62
+ matrix:
63
+ include:
64
+ # Linux GNU
65
+ - os: ubuntu-latest
66
+ target: x86_64-unknown-linux-gnu
67
+ # macOS
68
+ - os: macos-15
69
+ target: aarch64-apple-darwin
70
+ - os: macos-15
71
+ target: x86_64-apple-darwin
72
+ # Windows
73
+ - os: windows-latest
74
+ target: x86_64-pc-windows-msvc
75
+
76
+ steps:
77
+ - uses: actions/checkout@v6
78
+ with:
79
+ ref: ${{ inputs.sha || github.sha }}
80
+
81
+ - uses: actions/setup-python@v6
82
+ with:
83
+ python-version: '3.12'
84
+
85
+ - name: Build wheel
86
+ uses: PyO3/maturin-action@v1
87
+ with:
88
+ command: build
89
+ target: ${{ matrix.target }}
90
+ args: ${{ env.MATURIN_ARGS }} --out dist
91
+ manylinux: auto
92
+ maturin-version: ${{ env.MATURIN_VERSION }}
93
+
94
+ - uses: actions/upload-artifact@v6
95
+ with:
96
+ name: python-wheel-${{ matrix.target }}
97
+ path: dist/*.whl
98
+
99
+
100
+ publish-to-test-pypi:
101
+ name: Publish to TestPyPI
102
+ needs: [create-sdist, build-wheels]
103
+ runs-on: ubuntu-latest
104
+ environment:
105
+ name: release-python-test
106
+ url: https://test.pypi.org/project/nblf-queue
107
+ permissions:
108
+ id-token: write
109
+
110
+ steps:
111
+ - uses: actions/download-artifact@v7
112
+ with:
113
+ path: dist
114
+ merge-multiple: true
115
+
116
+ - name: Publish to TestPyPI
117
+ if: ${{ !inputs.dry-run }}
118
+ uses: pypa/gh-action-pypi-publish@release/v1
119
+ with:
120
+ repository-url: https://test.pypi.org/legacy/
121
+ skip-existing: true
122
+ verbose: true
123
+
124
+ publish-to-pypi:
125
+ name: Publish to PyPI
126
+ needs: [create-sdist, build-wheels, publish-to-test-pypi]
127
+ runs-on: ubuntu-latest
128
+ environment:
129
+ name: release-python
130
+ url: https://pypi.org/project/nblf-queue
131
+ permissions:
132
+ id-token: write
133
+
134
+ steps:
135
+ - uses: actions/download-artifact@v7
136
+ with:
137
+ path: dist
138
+ merge-multiple: true
139
+
140
+ - name: Publish to PyPI
141
+ if: ${{ !inputs.dry-run && !inputs.testpypi-only }}
142
+ uses: pypa/gh-action-pypi-publish@release/v1
143
+ with:
144
+ skip-existing: true
145
+ verbose: true
@@ -0,0 +1,108 @@
1
+ # This workflow runs checks for unsafe code. In crates that don't have any unsafe code, this can be
2
+ # removed. Runs:
3
+ # - miri - detects undefined behavior and memory leaks
4
+ # - address sanitizer - detects memory errors
5
+ # - leak sanitizer - detects memory leaks
6
+ # - loom - Permutation testing for concurrent code https://crates.io/crates/loom
7
+ # See check.yml for information about how the concurrency cancellation and workflow triggering works
8
+ permissions:
9
+ contents: read
10
+ on:
11
+ push:
12
+ branches: [main]
13
+ pull_request:
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16
+ cancel-in-progress: true
17
+ name: safety
18
+ jobs:
19
+ sanitizers:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
23
+ with:
24
+ submodules: true
25
+ - name: Install nightly
26
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
27
+ with:
28
+ toolchain: nightly
29
+ - run: |
30
+ # to get the symbolizer for debug symbol resolution
31
+ sudo apt install llvm
32
+ # to fix buggy leak analyzer:
33
+ # https://github.com/japaric/rust-san#unrealiable-leaksanitizer
34
+ # ensure there's a profile.dev section
35
+ if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then
36
+ echo >> Cargo.toml
37
+ echo '[profile.dev]' >> Cargo.toml
38
+ fi
39
+ # remove pre-existing opt-levels in profile.dev
40
+ sed -i '/^\s*\[profile.dev\]/,/^\s*\[/ {/^\s*opt-level/d}' Cargo.toml
41
+ # now set opt-level to 1
42
+ sed -i '/^\s*\[profile.dev\]/a opt-level = 1' Cargo.toml
43
+ cat Cargo.toml
44
+ name: Enable debug symbols
45
+ - name: cargo test -Zsanitizer=address
46
+ # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945
47
+ run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu
48
+ env:
49
+ ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
50
+ RUSTFLAGS: "-Z sanitizer=address"
51
+ - name: cargo test -Zsanitizer=leak
52
+ if: always()
53
+ run: cargo test --all-features --target x86_64-unknown-linux-gnu
54
+ env:
55
+ LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
56
+ RUSTFLAGS: "-Z sanitizer=leak"
57
+ miri:
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
61
+ with:
62
+ submodules: true
63
+ - run: |
64
+ echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> "$GITHUB_ENV"
65
+ - name: Install ${{ env.NIGHTLY }}
66
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
67
+ with:
68
+ toolchain: ${{ env.NIGHTLY }}
69
+ components: miri
70
+ - name: install miri
71
+ run: rustup component add miri --toolchain ${{ env.NIGHTLY }}
72
+ - name: cargo miri test
73
+ run: |
74
+ rustup override set ${{ env.NIGHTLY }}
75
+ cargo miri test
76
+ env:
77
+ MIRIFLAGS: ""
78
+
79
+ loom:
80
+ runs-on: ubuntu-latest
81
+ steps:
82
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
83
+ with:
84
+ submodules: true
85
+ - name: Install stable
86
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
87
+ with:
88
+ toolchain: stable
89
+ - name: cargo test loom
90
+ run: cargo test --lib --features dynamic
91
+ env:
92
+ LOOM_MAX_PREEMPTIONS: 2
93
+ RUSTFLAGS: "--cfg loom"
94
+
95
+ shuttle:
96
+ runs-on: ubuntu-latest
97
+ steps:
98
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
99
+ with:
100
+ submodules: true
101
+ - name: Install stable
102
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
103
+ with:
104
+ toolchain: stable
105
+ - name: cargo test shuttle
106
+ run: cargo test --lib --features dynamic
107
+ env:
108
+ RUSTFLAGS: "--cfg shuttle"
@@ -0,0 +1,62 @@
1
+ # Run scheduled (rolling) jobs on a nightly basis, as your crate may break independently of any
2
+ # given PR. E.g., updates to rust nightly and updates to this crates dependencies. See check.yml for
3
+ # information about how the concurrency cancellation and workflow triggering works
4
+ permissions:
5
+ contents: read
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ schedule:
11
+ - cron: '7 7 * * *'
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14
+ cancel-in-progress: true
15
+ name: rolling
16
+ jobs:
17
+ # https://twitter.com/mycoliza/status/1571295690063753218
18
+ nightly:
19
+ runs-on: ubuntu-latest
20
+ name: ubuntu / nightly
21
+ steps:
22
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
23
+ with:
24
+ submodules: true
25
+ - name: Install nightly
26
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
27
+ with:
28
+ toolchain: nightly
29
+ - name: cargo generate-lockfile
30
+ if: hashFiles('Cargo.lock') == ''
31
+ run: cargo generate-lockfile
32
+ - name: cargo test --locked
33
+ run: cargo test --locked --all-features --all-targets
34
+ # https://twitter.com/alcuadrado/status/1571291687837732873
35
+ update:
36
+ # This action checks that updating the dependencies of this crate to the latest available that
37
+ # satisfy the versions in Cargo.toml does not break this crate. This is important as consumers
38
+ # of this crate will generally use the latest available crates. This is subject to the standard
39
+ # Cargo semver rules (i.e cargo does not update to a new major version unless explicitly told
40
+ # to).
41
+ runs-on: ubuntu-latest
42
+ name: ubuntu / beta / updated
43
+ # There's no point running this if no Cargo.lock was checked in in the first place, since we'd
44
+ # just redo what happened in the regular test job. Unfortunately, hashFiles only works in if on
45
+ # steps, so we repeat it.
46
+ steps:
47
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
48
+ with:
49
+ submodules: true
50
+ - name: Install beta
51
+ if: hashFiles('Cargo.lock') != ''
52
+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # branch=master
53
+ with:
54
+ toolchain: beta
55
+ - name: cargo update
56
+ if: hashFiles('Cargo.lock') != ''
57
+ run: cargo update
58
+ - name: cargo test
59
+ if: hashFiles('Cargo.lock') != ''
60
+ run: cargo test --locked --all-features --all-targets
61
+ env:
62
+ RUSTFLAGS: -D deprecated