-
Notifications
You must be signed in to change notification settings - Fork 7
111 lines (94 loc) · 3.41 KB
/
ci.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
name: CI
on:
schedule:
- cron: 00 00 * * 1 # run every Monday at 00:00
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
test_server: [false]
include:
- os: macos-latest
python: 3.9
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python }}
- name: Install Python
run: uv python install --python-preference only-managed ${{ matrix.python }}
- name: Install dependencies
run: |
uv sync --all-extras
uv pip install codecov
uv tool install \
--python-preference only-managed ${{ matrix.python }} \
tox --with tox-uv --with tox-gh
- name: Install R
if: matrix.test_server
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.4.1
- name: Get R cache dir
uses: actions/cache@v4
if: matrix.test_server
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
- name: Install OmnipathR
if: matrix.test_server
run: |
sudo apt-get install libcurl4-openssl-dev
sudo Rscript --vanilla -e "if (!(requireNamespace('BiocManager', quietly=TRUE))) { install.packages(c('BiocManager', 'curl'), repos='https://cloud.r-project.org/') }; BiocManager::install('OmnipathR')"
Rscript --vanilla -e "packageVersion('OmnipathR')"
- name: Set up test suite
env:
TOX_GH_MAJOR_MINOR: ${{ matrix.python }}
run: |
tox run -vv --notest --skip-missing-interpreters true
- name: Run tests
env:
TOX_GH_MAJOR_MINOR: ${{ matrix.python }}
run: |
tox run -vv --skip-pkg-install
- name: Upload coverage to Codecov
if: success()
env:
CODECOV_NAME: ${{ matrix.python }}-${{ matrix.os }}
run: |
uv run codecovcli --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n $CODECOV_NAME -F unittests
deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build a binary wheel and a source tarball
run: uv build
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
skip_existing: true
verbose: true