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

v29 #206

Merged
merged 2 commits into from
Jan 25, 2025
Merged

v29 #206

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
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ jobs:
tool: cargo-nextest
- run: cargo make check --features "${{ matrix.features }}"

miri:
name: test-with-miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
toolchain: nightly
components: miri
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- run: cargo make miri

build-docs:
name: build-docs
Expand All @@ -65,3 +80,24 @@ jobs:
cargo +nightly docs-rs -pautd3-link-twincat
cargo +nightly docs-rs -pautd3-modulation-audio-file
cargo +nightly docs-rs -pautd3-protobuf

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
components: llvm-tools
- uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- run: cargo make cov lcov
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage
disable_search: true
fail_ci_if_error: true
39 changes: 0 additions & 39 deletions .github/workflows/coverage.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ jobs:
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- run: |
cargo make -e CARGO_TOOLCHAIN=${{ inputs.channel }} miri
- run: cargo make -e CARGO_TOOLCHAIN=${{ inputs.channel }} miri
41 changes: 41 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ jobs:
- if: ${{ needs.test.result == 'failure' || needs.test.result == 'cancelled' }}
run: exit 1

miri:
needs: changed-files
if: ${{ needs.changed-files.outputs.src == 'true' }}
name: test-with-miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
toolchain: nightly
components: miri
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- run: cargo make miri

build-docs:
needs: changed-files
if: ${{ needs.changed-files.outputs.src == 'true' }}
Expand All @@ -93,10 +111,33 @@ jobs:
cargo +nightly docs-rs -pautd3-modulation-audio-file
cargo +nightly docs-rs -pautd3-protobuf

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
components: llvm-tools
- uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- run: cargo make cov lcov
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage
disable_search: true
fail_ci_if_error: true

auto-merge:
needs:
- all-tests-passed
- miri
- build-docs
- coverage
permissions:
pull-requests: write
contents: write
Expand Down
20 changes: 4 additions & 16 deletions autd3/src/datagram/gain/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ mod tests {

#[test]
fn with_parallel_unsafe() -> anyhow::Result<()> {
let geometry = create_geometry(5);
let geometry = create_geometry(2);

let mut rng = rand::thread_rng();

Expand All @@ -344,16 +344,13 @@ mod tests {
let gain = Group::new(|dev| {
let dev_idx = dev.idx();
move |tr| match (dev_idx, tr.idx()) {
(0, 0..=99) => Some("null"),
(0, 100..=199) => Some("test"),
(1, 200..) => Some("test2"),
(3, _) => Some("test"),
_ => None,
}
})
.set("null", Null {}.into_boxed())?
.set("test", g1.into_boxed())?
.set("test2", g2.into_boxed())?;
.set("test", g1)?
.set("test2", g2)?;

let mut g = gain.init_full(&geometry, None, true)?;
let drives = geometry
Expand All @@ -366,7 +363,7 @@ mod tests {
)
})
.collect::<HashMap<_, _>>();
assert_eq!(5, drives.len());
assert_eq!(2, drives.len());
drives[&0].iter().enumerate().for_each(|(i, &d)| match i {
i if i <= 99 => {
assert_eq!(Drive::NULL, d);
Expand All @@ -386,15 +383,6 @@ mod tests {
assert_eq!(d2, d);
}
});
drives[&2].iter().for_each(|&d| {
assert_eq!(Drive::NULL, d);
});
drives[&3].iter().for_each(|&d| {
assert_eq!(d1, d);
});
drives[&4].iter().for_each(|&d| {
assert_eq!(Drive::NULL, d);
});

Ok(())
}
Expand Down
Loading