-
Notifications
You must be signed in to change notification settings - Fork 2
150 lines (127 loc) · 4.01 KB
/
ci.yml
File metadata and controls
150 lines (127 loc) · 4.01 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: CI
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable, beta]
include:
- os: ubuntu-latest
rust: stable
cache-key: linux-stable
- os: macos-latest
rust: stable
cache-key: macos-stable
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install system dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
samtools \
bcftools
- name: Install system dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install samtools bcftools || true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ matrix.cache-key }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.cache-key }}-
- name: Build project
run: cargo build --release --verbose
- name: Test help command
run: |
cargo run --release -- --help || true
cargo run --release -- quick-start --help || true
cargo run --release -- filter --help || true
cargo run --release -- build --help || true
cargo run --release -- correct --help || true
cargo run --release -- call --help || true
cargo run --release -- asm --help || true
cargo run --release -- methyl --help || true
integration-test:
name: Integration Test
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
samtools \
bcftools
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build project
run: cargo build --release
- name: Test Himito quick-start command
run: |
if [ -f "test_data/HG005_100x.bam" ] && [ -f "test_data/HG005_100x.bai" ]; then
cargo run --release -- quick-start \
-i test_data/HG005_100x.bam \
-c "chrM" \
-k 21 \
--sampleid HG005 \
-r test_data/rCRS.fasta \
--output-prefix test_output/himito_test || echo "Himito test skipped - may require additional dependencies"
else
echo "Test data not available, skipping evaluate test"
fi
- name: Cleanup test outputs
if: always()
run: |
rm -rf test_output test_data || true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Check for common issues
run: |
# Check for unsafe code usage
if grep -r "unsafe" src/ --include="*.rs" | grep -v "// SAFETY" | grep -v "unsafe {"; then
echo "Warning: Found unsafe code without safety comments"
fi