-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
||
|
@@ -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 | ||
|
@@ -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 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: check if README matches MSRV defined here | ||
run: grep '1.66.0' 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 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters