forked from regulatory-genomics/precellar
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·95 lines (80 loc) · 2.48 KB
/
Copy pathtest_python.yml
File metadata and controls
executable file
·95 lines (80 loc) · 2.48 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
name: test-python-package
on: [push, pull_request]
jobs:
build-and-test:
outputs:
VERSION: ${{ steps.get-version.outputs.VERSION }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: nschloe/action-cached-lfs-checkout@v1
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 10
platform: x64
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
g++ \
libz-dev \
libbz2-dev \
liblzma-dev \
libstdc++-10-dev \
ninja-build
- uses: actions/setup-python@v6
name: Install Python
with:
python-version: '3.14'
- uses: ./.github/actions/setup-rust
with:
cache: true
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip --break-system-packages
python -m pip install --user pytest hypothesis==6.72.4 wheel maturin
- name: Build wheel files
env:
CFLAGS: "-Wno-error"
CXXFLAGS: "-Wno-error"
RUSTFLAGS: "-C target-cpu=x86-64"
run: |
cd ${GITHUB_WORKSPACE}/python
mkdir ${GITHUB_WORKSPACE}/wheel_files
pip wheel . --wheel-dir ${GITHUB_WORKSPACE}/wheel_files
- name: Test Python package
run: |
python -m pip install --user ${GITHUB_WORKSPACE}/wheel_files/*.whl
- name: Get precellar version
id: get-version
run: |
VERSION_NUMBER=$(python -c "import precellar;print(precellar.__version__)")
echo "Version: $VERSION_NUMBER"
echo "VERSION=$VERSION_NUMBER" >> $GITHUB_OUTPUT
- name: Upload wheel files as artifacts
uses: actions/upload-artifact@v4
with:
name: wheel-files
path: ./wheel_files/precellar*.whl
build-wheel:
needs: build-and-test
if: ${{ startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[wheel]') }}
uses: regulatory-genomics/precellar/.github/workflows/wheels.yml@main
publish:
needs: build-wheel
runs-on: ubuntu-latest
permissions:
id-token: write
if: ${{ startsWith(github.ref, 'refs/tags') }}
steps:
- name: Download wheel files
uses: actions/download-artifact@v4
with:
path: dist
pattern: precellar-*
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1