-
Notifications
You must be signed in to change notification settings - Fork 274
153 lines (125 loc) · 4.25 KB
/
ci.yaml
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
150
151
152
153
name: CI
on: [push, pull_request]
jobs:
direct:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
# Run only the latest few 3.x versions on macOS
- os: macos
python-version: 3.7
- os: macos
python-version: 3.8
- os: macos
python-version: 3.9
steps:
- name: Checkout pysam
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisite Python libraries
run: pip install cython pytest pytest-pep8 setuptools
- name: Install Linux build prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev
- name: Update macOS build prerequisites
if: runner.os == 'macOS'
run: |
brew unlink xz || true # Remove brewed liblzma as it is not multiarch
- name: Build (directly from checkout)
run: python setup.py build
- name: Install test prerequisites
run: |
case $RUNNER_OS in
Linux)
sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
;;
macOS)
brew install -q samtools bcftools
;;
esac
- name: Run tests
run: |
export PYTHONPATH=$(echo $GITHUB_WORKSPACE/build/lib.*)
export REF_PATH=':'
pytest
sdist:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos]
python-version: ['3.10']
steps:
- name: Checkout pysam
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisite Python libraries
run: pip install cython pytest pytest-pep8
- name: Install build prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev
- name: Create source distribution
run: python setup.py sdist --owner=root --group=root
- name: Build (via sdist tarball)
run: pip install --verbose --no-deps --no-binary=':all:' pysam-*.tar.gz
working-directory: dist
- name: Install test prerequisites
run: |
case $RUNNER_OS in
Linux)
sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
;;
macOS)
brew install -q samtools bcftools
;;
esac
- name: Run tests
run: REF_PATH=':' pytest
- name: Upload sdist tarball
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/pysam-*.tar.gz
retention-days: 14
conda:
timeout-minutes: 20
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
python-version: ['3.10']
defaults:
run:
shell: bash -el {0} # needed for conda activation
env:
HTSLIB_CONFIGURE_OPTIONS: "--disable-libcurl"
steps:
- name: Checkout pysam
uses: actions/checkout@v4
- name: Set up Conda and Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda
channel-priority: strict
python-version: ${{ matrix.python-version }}
environment-file: devtools/environment-dev.yaml
auto-activate-base: false
- name: Build (directly from checkout)
run: python setup.py install
- name: Install test prerequisites via Conda
run: conda install "samtools>=1.11" "bcftools>=1.11" "htslib>=1.11" pytest
- name: Run tests
run: REF_PATH=':' pytest