-
Notifications
You must be signed in to change notification settings - Fork 41
135 lines (109 loc) · 3.17 KB
/
Copy pathci-cd.yml
File metadata and controls
135 lines (109 loc) · 3.17 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
name: CI/CD
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
ci_pip:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Cleanup build folder 🧹
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Setup Python 3.12 🐍
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup backend 🏗️
run: |
pip install uv
uv pip install --system hatch pytest pytest-rerunfailures autoflake==1.7 isort==6.0 black==25.1
- name: Checkout 🛎️
uses: actions/checkout@v4
# Builds a wheel needed for the CD
- name: Build wheel 🎡
run: hatch build -t wheel
# Store the wheel in GitHub Actions
- name: Upload artifact ❄️
uses: actions/upload-artifact@v4
with:
name: genomepy_wheel
path: dist/
# Test if the created wheel can be installed
- name: Install 🛠️
run: uv pip install --system dist/*.whl --force-reinstall
- name: Unit tests 📜
run: pytest -vvv --reruns 1 --reruns-delay 10 tests/test_01_basic.py
- name: Integration tests 📚
run: |
genomepy --help
genomepy annotation --help
genomepy install --help
genomepy search --help
ci_conda:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Cleanup build folder 🧹
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup backend 🏗️
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-version: latest
- name: Install 🛠️
run: pip install . --no-deps --ignore-installed
- name: Unit tests 📜
run: pytest -vvv --reruns 1 --reruns-delay 10 tests/test_01_basic.py
- name: Integration tests 📚
run: |
genomepy --help
genomepy annotation --help
genomepy install --help
genomepy search --help
cd:
needs: ci_pip
runs-on: ubuntu-latest
# Only run this job if new work is pushed to "master"
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# # Only run this job on a tagged commit
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Cleanup build folder 🧹
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Setup Python 3.12 🐍
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: mkdir -p dist
- name: Download artifact ❄️
uses: actions/download-artifact@v4
with:
name: genomepy_wheel
path: dist/
- name: Publish to PyPI 🚀
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}