-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (103 loc) · 3.2 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
on: [push, pull_request]
name: Tests & Lints
jobs:
rust:
name: Rust Tests & Lints
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- name: Check out Repository
uses: actions/checkout@v2
- name: Rust cache
id: rust-cache
uses: actions/cache@v2
with:
path: |
/usr/share/rust/.cargo/registry
/usr/share/rust/.cargo/git
implementation/target
key: ${{ runner.os }}-cargo-${{ hashFiles('implementation/**') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
- name: Install cargo-tarpaulin
uses: actions-rs/install@v0.1
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true
- name: Cargo Check
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path implementation/Cargo.toml
- name: Cargo Test
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path implementation/Cargo.toml
- name: Cargo Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path implementation/Cargo.toml -- --check
- name: Cargo Lint
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets --manifest-path implementation/Cargo.toml -- -D warnings
# - name: Coverage Report with tarpaulin
# uses: actions-rs/cargo@v1
# with:
# command: tarpaulin
# args: --manifest-path implementation/Cargo.toml --all --all-features --timeout 600 --out Lcov -- --test-threads 1
#
# - name: Upload Coverage
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./lcov.info
# snakemake:
# name: Snakemake Tests
# runs-on: ubuntu-latest
# #needs: rust
# steps:
# - name: Check out Repository
# uses: actions/checkout@v2
#
# - name: Cache
# uses: actions/cache@v1
# env:
# # Increase this value to reset cache
# CACHE_NUMBER: 0
# with:
# path: |
# implementation/target
# data
# conda_pkgs_dir
# key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('implementation/**', 'environment.yml', 'Snakefile', 'scripts/*') }}
#
# - name: Setup miniconda
# uses: conda-incubator/setup-miniconda@v2
# with:
# activate-environment: practical-omnitigs
# python-version: 3.8
# environment-file: environment.yml
# auto-update-conda: true
# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
#
# - name: Run snakemake tests
# shell: bash -l {0}
# run: |
# conda activate practical-omnitigs
# snakemake --cores 1 test