Skip to content

Commit

Permalink
Merge branch 'master' into cli
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Dec 23, 2019
2 parents 5135b6e + ba5b5a1 commit 43b4451
Show file tree
Hide file tree
Showing 82 changed files with 4,149 additions and 3,261 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ omit =
doc/conf.py
setup.py
tests/*
third-party/smhasher/MurmurHash3.cc
.tox/*
benchmarks/*
7 changes: 7 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
branch: true
ignore-not-existing: true
llvm: true
filter: covered
output-type: lcov
output-file: ./lcov.info
prefix-dir: /home/user/build/
257 changes: 257 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
name: Rust checks

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

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

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [beta, stable, windows, macos]
include:
- build: macos
os: macos-latest
rust: stable
- build: windows
os: windows-latest
rust: stable
- build: beta
os: ubuntu-latest
rust: beta
- build: stable
os: ubuntu-latest
rust: stable
steps:
- uses: actions/checkout@v1

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

- name: Set up Python 3.8
if: matrix.os != 'windows-latest'
uses: actions/setup-python@v1
with:
python-version: "3.8"

- name: Install dependencies
if: matrix.os != 'windows-latest'
run: |
python -m pip install --upgrade pip
python -m pip install -e .
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast

test_all_features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

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

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --all --all-features

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --all --all-features
env:
'CARGO_INCREMENTAL': '0'
'RUSTFLAGS': '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads'

- name: Collect coverage and generate report with grcov
uses: actions-rs/grcov@v0.1.4
id: coverage

- name: Upload coverage to codecov
uses: codecov/codecov-action@v1.0.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

wasm-pack:
name: Check if wasm-pack builds a valid package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: install
args: --force wasm-pack
- name: run wasm-pack
run: wasm-pack build

wasm32-wasi:
name: Run tests under wasm32-wasi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- 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 "::add-path::$HOME/.wasmtime/bin"
- 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
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 (dry-run)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

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

- name: Make sure we can publish the crate
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run

minimum_rust_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions-rs/toolchain@v1
with:
toolchain: 1.34.0
override: true

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast
18 changes: 12 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ dist
build
sourmash.egg-info
.ipynb_checkpoints
_minhash.so
.cache
*.so
.coverage
sourmash_lib/_minhash.cpp
sourmash/_minhash.cpp
.asv/
.eggs/
.pytest_cache
.python-version
sourmash/version.py
*.DS_Store
*.DS_Store
.tox
sourmash/_lowlevel*.py
.env
Pipfile
Pipfile.lock
target/
Cargo.lock
.eggs
.asv
pkg/
wasm-pack.log
Loading

0 comments on commit 43b4451

Please sign in to comment.