Skip to content

Commit

Permalink
Merge branch 'latest' into ctb_hacky_rocksdb
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Feb 3, 2025
2 parents d99caad + 1b1d527 commit 0f5fa61
Show file tree
Hide file tree
Showing 32 changed files with 280 additions and 262 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ jobs:
with:
python-version: "3.10"

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_envs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- run: nix run .# -- --version

- run: nix develop --command bash -c "tox -e py310"
- run: nix develop --command bash -c "tox -e py311"

pixi:
runs-on: ${{ matrix.os }}
Expand All @@ -39,7 +39,7 @@ jobs:
- name: set up pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.26.1
pixi-version: v0.39.5
cache: true
frozen: true

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}

- name: setup conda
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830
with:
python-version: "3.10"
miniforge-version: latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-v4-
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
174 changes: 57 additions & 117 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
run: |
cargo check
test:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -53,32 +49,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
override: true

- uses: Swatinem/rust-cache@v2

- uses: taiki-e/install-action@nextest

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast
run: |
cargo nextest run
test_all_features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- uses: actions-rs/install@v0.1
- uses: taiki-e/install-action@v2
with:
crate: cargo-all-features
version: latest
use-tool-cache: true
tool: cargo-all-features

- name: Run tests for all feature combinations
run: cargo test-all-features --no-fail-fast --all
Expand All @@ -88,29 +82,23 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2

- name: Install cargo-binstall
run: |
wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-gnu.tgz
tar xf cargo-binstall-x86_64-unknown-linux-gnu.tgz
chmod +x cargo-binstall
mv cargo-binstall "$HOME/.cargo/bin"
- name: Install cargo-tarpaulin
run: cargo binstall --no-confirm cargo-tarpaulin
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest

- name: Coverage with tarpaulin
run: cargo tarpaulin --all --all-features --timeout 600 --out xml -- --test-threads 1
- name: Collect coverage data
run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info

- name: Upload Rust coverage to codecov
uses: codecov/codecov-action@v3
with:
flags: rust
fail_ci_if_error: true
files: lcov.info

lints:
name: Lints
Expand All @@ -129,36 +117,33 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
components: "clippy, rustfmt"

- uses: Swatinem/rust-cache@v2

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: |
cargo fmt --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings
run: |
cargo clippy --all -- -D warnings
wasm-pack:
name: Check if wasm-pack builds a valid package for the sourmash crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v2

- name: Install wasm-pack
run: "curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh"

Expand Down Expand Up @@ -190,51 +175,16 @@ jobs:
with:
path: 'pkg/sourmash*.tgz'

wasm32-wasi:
name: Run tests under wasm32-wasi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install wasm32-wasi target
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-wasi
- name: Install wasmtime
run: "curl https://wasmtime.dev/install.sh -sSf | bash"
- name: Add wasmtime to PATH
run: echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
- name: Install cargo-wasi command
uses: actions-rs/cargo@v1
with:
command: install
args: --force cargo-wasi
- name: Build code with cargo-wasi
uses: actions-rs/cargo@v1
continue-on-error: true ## TODO: remove this when build works...
with:
command: wasi
args: build
- name: Run tests under wasm32-wasi
uses: actions-rs/cargo@v1
continue-on-error: true ## TODO: remove this when tests work...
with:
command: wasi
args: test

publish:
name: Publish (on tags, dry-run otherwise)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
Expand All @@ -245,62 +195,52 @@ jobs:
features: branchwater

- name: Make sure we can publish the sourmash crate
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run --manifest-path src/core/Cargo.toml
run: |
cargo publish --dry-run --manifest-path src/core/Cargo.toml
# Login to crates.io on tags
- name: login to crates.io
uses: actions-rs/cargo@v1
if: startsWith(github.ref, 'refs/tags/r')
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
run: |
cargo login ${{ secrets.CRATES_IO_TOKEN }}
# Publish to crates.io on tags
- name: Publish to crates.io
if: startsWith(github.ref, 'refs/tags/r')
uses: actions-rs/cargo@v1
with:
command: publish
args: --manifest-path src/core/Cargo.toml
run: |
cargo publish --manifest-path src/core/Cargo.toml
minimum_rust_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.66.0"
override: true
toolchain: "1.71.1"

- uses: Swatinem/rust-cache@v2

- name: check if README matches MSRV defined here
run: grep '1.66.0' src/core/README.md
run: grep '1.71.1' src/core/README.md

- name: Check if it builds properly
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
run: |
cargo build --all-features
check_cbindgen:
name: "Check if cbindgen runs cleanly for generating the C headers"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- uses: actions-rs/install@v0.1
- uses: taiki-e/install-action@v2
with:
crate: cbindgen
version: 0.20.0
use-tool-cache: true
tool: [email protected]

- run: make include/sourmash.h

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: check-toml
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.9.3
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"
rust: "1.70"
rust: "1.75"
apt_packages:
- llvm-dev
- libclang-dev
Expand Down
Loading

0 comments on commit 0f5fa61

Please sign in to comment.