Skip to content

Commit

Permalink
lint corrections, doc corrections, workflow improvements and num-trai…
Browse files Browse the repository at this point in the history
…ts dep update
ABouttefeux committed Nov 9, 2023
1 parent 4c1768b commit 088e0de
Showing 22 changed files with 290 additions and 134 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benches.yml
Original file line number Diff line number Diff line change
@@ -10,13 +10,13 @@ env:

jobs:
bench:
name: Run checks for Lattice QCD rs
name: Run benches for Lattice QCD rs
runs-on: ubuntu-latest
# env:
# CRITERION_TOKEN: ${{ secrets.CRITERION_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
22 changes: 11 additions & 11 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -3,34 +3,34 @@ name: coverage
env:
CARGO_TERM_COLOR: always

on: [push]
on:
push:

jobs:
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly

- name: Install llvm-tools-preview
run: |
rustup default nightly
rustup component add llvm-tools-preview
components: llvm-tools-preview
default: true

- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -

- name: Generate code coverage
run: |
export RUSTFLAGS="-Zinstrument-coverage"
export RUSTDOCFLAGS="-Zinstrument-coverage -Zunstable-options --persist-doctests target/debug/doctestbins"
cargo +nightly build --verbose --all --no-default-features --features="serde-serialize"
LLVM_PROFILE_FILE="lattice_qcd_rs-%p-%m.profraw" cargo +nightly test --verbose --no-default-features --features="serde-serialize" --workspace --exclude lattice_qcd_rs-procedural_macro
export RUSTFLAGS="-Cinstrument-coverage"
export RUSTDOCFLAGS="-Cinstrument-coverage -Zunstable-options --persist-doctests target/debug/doctestbins"
export LLVM_PROFILE_FILE="lattice_qcd_rs-%p-%m.profraw"
cargo +nightly test --verbose --all --no-default-features --features="serde-serialize"
cargo +nightly test --verbose --all --no-default-features --features="serde-serialize" --examples
- name: parse code coverage
run: ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
6 changes: 3 additions & 3 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ name: fmt

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

@@ -16,13 +15,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt,
components: rustfmt
default: true

- name: fmt
run: cargo +nightly fmt --all -- --check
47 changes: 37 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ name: Rust

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

@@ -16,23 +15,51 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
profile: [test, release]
exclude:
- os: windows-latest
profile: release
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true

- name: Build with serd
run: cargo build --all --verbose --features serde-serialize

- name: Run tests with serd
run: cargo test --all --verbose --features serde-serialize
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize"

- name: Run examples tests with serd
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples

- name: Build no features
run: cargo build --all --verbose --no-default-features --features overflow-test

# it is faster to keep the going and reuse previous compilation artefact than using
# a matrix strategy and starting all over again
- name: Run tests no features
run: cargo test --all --verbose --no-default-features --features overflow-test
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test"

- name: Run examples tests no features
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples

linter:
name: lint code on nightly release
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
default: true

- name: Linter
run: cargo +nightly clippy --all --verbose --tests --all-features -- --no-deps --deny warnings

- name: Linter release
run: cargo +nightly clippy --all --verbose --tests --release --all-features -- --no-deps --deny warnings
30 changes: 16 additions & 14 deletions .github/workflows/rust_beta.yml
Original file line number Diff line number Diff line change
@@ -9,26 +9,28 @@ env:

jobs:
build-beta:

name: rust beta check
runs-on: ubuntu-latest
strategy:
matrix:
profile: [test, release]

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust beta toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: beta

- name: Build beta with serd
run: cargo build --all --verbose --features serde-serialize

default: true

- name: Run tests beta with serd
run: cargo test --all --verbose --features serde-serialize

- name: Build beta no features
run: cargo build --all --verbose --no-default-features --features overflow-test

- name: Run tests beta no features
run: cargo test --all --verbose --no-default-features --features overflow-test
run: cargo +beta test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize"
- name: Run example tests beta with serd
run: cargo +beta test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples

- name: Run tests beta without serd
run: cargo +beta test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test"
- name: Run example tests beta without serd
run: cargo +beta test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples
9 changes: 5 additions & 4 deletions .github/workflows/rust_doc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Rust-Doc
name: Rust doc publish

on:
push:
branches: [ main, develop ]
branches: [ main ]

env:
CARGO_TERM_COLOR: always
@@ -14,15 +14,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true

- name: Doc
run: cargo doc --all --no-deps
run: cargo doc --all --no-deps --all-features

- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
6 changes: 3 additions & 3 deletions .github/workflows/rust_doc_check.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ name: Rust Doc check

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

@@ -16,12 +15,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true

- name: Doc
run: cargo doc --all --no-deps
run: cargo +stable doc --all --no-deps --document-private-items --all-features
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,14 +2,25 @@
# v0.3.0

## breaking changes
- [`SymplecticEulerError`](https://abouttefeux.github.io/lattice-qcd-rs/lattice_qcd_rs/integrator/symplectic_euler/enum.SymplecticEulerError.html) is now marked `#[non_exhaustive]`
- update dependencies
- [`SymplecticEulerError`](hnew_deterministtps://abouttefeux.github.io/lattice-qcd-rs/lattice_qcd_rs/integrator/symplectic_euler/enum.SymplecticEulerError.html) is now marked `#[non_exhaustive]`
- change the feature "no-overflow-test" to "overflow-test" and enabling "overflow-test" by default
- [`Su3Adjoint::random`] now takes the distribution as a generic parameter instead of an impl trait type and can be unsized
- [`EField::new_random`] now takes the distribution as a generic parameter instead of an impl trait type and can be unsized
- [`EField::new_determinist`] now takes the distribution as a generic parameter instead of an impl trait type and can be unsized
- [`LatticeStateDefault::new_determinist`] now takes the rng as a generic parameter instead of an impl trait type and can be unsized
- [`LatticeStateEFSyncDefault::new_random_e_state`] now takes the rng as a generic parameter instead of an impl trait type and can be unsized
- [`LatticeStateEFSyncDefault::new_determinist`] now takes the distribution as a generic parameter instead of an impl trait type and can be unsized


## non breaking
- update dependencies
- remove the extern crate declaration in lib.rs
- correct documentation
- add `#[inline]` to a all public facing function
- add methods [`inter`] and [`iter_mut`] to [`EField`]
- [`LatticeStateEFSyncDefault::new_random_threaded`] now takes unsized distribution.
- [`LinkMatrix`::iter`] and [`LinkMatrix::iter_mut`] now also implements [`DoubleEndedIterator`]
- moved the definition of [`DirectionConversionError`] out of the proc macro into lattice.rs

# v0.2.1

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ members = ["procedural_macro"]
[dependencies]
nalgebra = { version = "0.32", features = ["serde-serialize"] }
approx = "0.5.1"
num-traits = "0.2.16"
num-traits = "0.2.17"
rand = "0.8.5"
rand_distr = "0.4.3"
crossbeam = "0.8.2"
2 changes: 2 additions & 0 deletions procedural_macro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

- update version-sync to 0.9.5
- added doc on direction const item
- moved the definition of [`DirectionConversionError`] out of the proc macro into lattice.rs


# v0.2.1

Loading

0 comments on commit 088e0de

Please sign in to comment.