Skip to content

Commit

Permalink
Add tests and CI (#11)
Browse files Browse the repository at this point in the history
So #10 can be tested =P
  • Loading branch information
luizirber authored Oct 1, 2022
1 parent d3c03e4 commit f70ec1c
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Rust checks

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

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
args: --manifest-path searcher/Cargo.toml

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [beta, stable]
include:
- 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: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --manifest-path searcher/Cargo.toml

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 --manifest-path searcher/Cargo.toml -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path searcher/Cargo.toml -- -D warnings
172 changes: 172 additions & 0 deletions searcher/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions searcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ serde_json = "1.0.79"
niffler = "2.4.0"
log = "0.4.14"
env_logger = "0.9.0"

[dev-dependencies]
assert_cmd = "2.0.4"
assert_matches = "1.5.0"
predicates = "2.1.1"
tempfile = "3.3.0"
1 change: 1 addition & 0 deletions searcher/tests/data/genome-s10.fa.gz.sig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"class":"sourmash_signature","email":"","hash_function":"0.murmur64","filename":"../genome-s10.fa.gz","license":"CC0","signatures":[{"num":0,"ksize":31,"seed":42,"max_hash":1844674407370955,"mins":[30807374014407,57757612406942,66802006065227,93749377441657,180725499715323,204071187423962,222251804657295,383550092736406,404680749850337,428826126693272,527010193814289,586944462641177,621469634901311,650400501644310,694452048593312,711796760984226,763990431249073,796340894958088,807182880479890,832723642635445,833951912068389,835611144117353,917664535291844,944861144892856,947350932899290,960253372716129,996771440047709,1006580187050746,1007211062656682,1078584030564363,1113634793641498,1131757223799833,1227539422471232,1279029402629146,1286655421055676,1311604457296941,1344155412543000,1413828164652611,1475306543173579,1484092490448841,1527957201371692,1555059455114724,1588006882382533,1596586810934220,1601839650445404,1739758684393454,1757916833279658,1819323021224724],"md5sum":"684aa226f843eaa7e1e40fc5603d5f2a","molecule":"dna"}],"version":0.4}]
1 change: 1 addition & 0 deletions searcher/tests/data/genome-s11.fa.gz.sig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"class":"sourmash_signature","email":"","hash_function":"0.murmur64","filename":"../genome-s11.fa.gz","license":"CC0","signatures":[{"num":0,"ksize":31,"seed":42,"max_hash":1844674407370955,"mins":[62742121440776,116682508153136,123470632334374,171395183363180,259806423646378,296222212281285,316101341485088,335517318379724,342235403058706,372220710502218,395679040987570,486474781856218,501737310713979,513963359772125,517206764912218,536080090837999,557296703518784,789361198254004,876191041280893,923091879889105,1041434451417868,1060973346735565,1076193919932584,1078830330869677,1109012404096060,1122758845345273,1125125376375867,1148792696258827,1199336925926527,1203102333807228,1255977929207456,1293147505464497,1319342497253366,1459122636955914,1518235962441549,1533340098245745,1578008991811199,1585173787447114,1674554665566329,1699936347324818,1708708457648792,1709325775873641,1806336745307859,1821683475928935,1838882153014188],"md5sum":"7ffcfaa4027d4153a991b6bd78cf39fe","molecule":"dna"}],"version":0.4}]
1 change: 1 addition & 0 deletions searcher/tests/data/genome-s12.fa.gz.sig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"class":"sourmash_signature","email":"","hash_function":"0.murmur64","filename":"../genome-s12.fa.gz","license":"CC0","signatures":[{"num":0,"ksize":31,"seed":42,"max_hash":1844674407370955,"mins":[61684531578209,85771769135580,135481858169414,145613169630587,158900194242036,187488401810094,401931523863428,488631545243238,542476954328872,549354994541497,578791919875463,590222143508976,663776913330781,743813632104820,752433086944547,760669641467696,781611029710848,793960459078570,844592394790229,963945439567632,979829169620899,980044439443436,1075352266403401,1079812539046566,1127077186922492,1167157075967875,1168326749098990,1228287306753073,1274514664173567,1416156285237060,1513658309796591,1532864882210721,1553704479759933,1554538698486601,1597174043244504,1604125218201751,1629287068676804,1629927722362012,1691580759029342,1692923411999067,1704974988766534,1772958528747502,1818178797566903,1832394902331060,1836478256458666],"md5sum":"d84ef28f610b1783f801734699cf7e40","molecule":"dna"}],"version":0.4}]
Loading

0 comments on commit f70ec1c

Please sign in to comment.