Skip to content

Commit df9b190

Browse files
committed
restore CI
1 parent e611bc0 commit df9b190

File tree

1 file changed

+179
-172
lines changed

1 file changed

+179
-172
lines changed

.github/workflows/test_and_publish.yml

Lines changed: 179 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -3,180 +3,182 @@ name: Test code and publish package
33
on: [push]
44

55
jobs:
6-
# test:
7-
# runs-on: ${{ matrix.os }}
8-
9-
# strategy:
10-
# fail-fast: false
11-
# matrix:
12-
# os: ["ubuntu-latest", "macos-latest", "macos-13", "windows-2019"]
13-
# python-version: ["3.9", "3.10", "3.11", "3.12"]
14-
15-
# defaults: # Needed for conda
16-
# run:
17-
# shell: bash -l {0}
18-
19-
# steps:
20-
# - uses: actions/checkout@v4
21-
# with:
22-
# lfs: true
23-
# submodules: true
24-
25-
# - uses: conda-incubator/setup-miniconda@v3
26-
# with:
27-
# python-version: ${{ matrix.python-version }}
28-
# channels: acellera,conda-forge,defaults
29-
30-
# - name: Lint with flake8
31-
# run: |
32-
# pip install flake8 coverage pytest-cov pytest pytest-subtests
33-
# # stop the build if there are Python syntax errors or undefined names
34-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37-
38-
# - name: Install moleculekit conda deps
39-
# run: |
40-
# conda install -y -q --file extra_requirements.txt python=${{ matrix.python-version }} -c acellera -c conda-forge
41-
# # scikit-learn, joblib, biopython are only used for rarely-used functions in smallmol
42-
# conda install -y -q scikit-learn joblib biopython -c conda-forge
43-
44-
# # - name: Install cdpkit
45-
# # # if: ${{ matrix.os == 'ubuntu-latest' }}
46-
# # run: |
47-
# # # for testing CDPKit SmallMol
48-
# # pip install CDPKit
49-
50-
# - name: Install moleculekit
51-
# run: |
52-
# pip install "numpy>=1.23.5" "Cython>=0.29.21"
53-
# pip install .
54-
# pip install "versioneer==0.28"
55-
# python setup.py build_ext --inplace
56-
57-
# - name: List conda environment
58-
# run: conda list
59-
60-
# - name: Test
61-
# run: |
62-
# pytest ./moleculekit
63-
# env:
64-
# GITHUB_ACTIONS: 1
65-
66-
# # - name: Upload coverage to Codecov
67-
# # uses: codecov/codecov-action@v3
68-
69-
# deploypypi:
70-
# if: startsWith(github.event.ref, 'refs/tags/')
71-
# needs: test
72-
# runs-on: ${{ matrix.os }}
73-
74-
# strategy:
75-
# fail-fast: false
76-
# matrix:
77-
# os: ["ubuntu-latest"]
78-
# python-version: ["3.10"]
79-
80-
# steps:
81-
# - uses: actions/checkout@v4
82-
83-
# - uses: conda-incubator/setup-miniconda@v3
84-
# with:
85-
# activate-environment: deploy
86-
# python-version: ${{ matrix.python-version }}
87-
88-
# - name: Build PyPI 📦
89-
# run: |
90-
# pip install numpy>=1.23.5 Cython>=0.29.21 build
91-
# python -m build --sdist --outdir dist/ .
92-
93-
# - name: Publish distribution 📦 to PyPI
94-
# uses: pypa/gh-action-pypi-publish@release/v1
95-
# with:
96-
# password: ${{ secrets.PUBLIC_PYPI_API_TOKEN }}
97-
# skip_existing: true
98-
99-
# deploy_linux:
100-
# if: startsWith(github.event.ref, 'refs/tags/')
101-
# needs: test
102-
# runs-on: ${{ matrix.os }}
103-
# container: ${{ matrix.container }}
104-
105-
# strategy:
106-
# fail-fast: false
107-
# matrix:
108-
# os: ["ubuntu-latest"]
109-
# python-version: ["3.10"]
110-
# container: ["quay.io/pypa/manylinux_2_28_x86_64"]
111-
112-
# steps:
113-
# - uses: actions/checkout@v4
114-
115-
# - uses: conda-incubator/setup-miniconda@v2
116-
# with:
117-
# miniconda-version: "latest"
118-
# activate-environment: ../deploy-env
119-
# python-version: ${{ matrix.python-version }}
120-
121-
# - name: Install build deps
122-
# shell: bash -l {0}
123-
# run: |
124-
# git config --global --add safe.directory '*'
125-
# conda install anaconda-client rattler-build python=${{ matrix.python-version }} -c conda-forge
126-
# pip install versioneer==0.28 toml pyyaml
127-
128-
# - name: Build conda package
129-
# shell: bash -l {0}
130-
# run: |
131-
# python package/moleculekit/insert_placeholder_values.py
132-
# rattler-build build --recipe ./package/moleculekit/recipe.yaml --output-dir ../pkg/ --no-include-recipe -c acellera -c conda-forge
133-
134-
# - name: Upload to conda
135-
# shell: bash -l {0}
136-
# run: |
137-
# anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera ../pkg/*/moleculekit-*.conda
138-
139-
# deploy_osx_win:
140-
# if: startsWith(github.event.ref, 'refs/tags/')
141-
# needs: test
142-
# runs-on: ${{ matrix.os }}
143-
144-
# strategy:
145-
# fail-fast: false
146-
# matrix:
147-
# os: ["macos-latest", "macos-13", "windows-2019"]
148-
# python-version: ["3.10"]
149-
150-
# steps:
151-
# - uses: actions/checkout@v4
152-
153-
# - uses: ilammy/msvc-dev-cmd@v1
154-
155-
# - uses: conda-incubator/setup-miniconda@v3
156-
# with:
157-
# miniconda-version: "latest"
158-
# activate-environment: ../deploy-env
159-
# python-version: ${{ matrix.python-version }}
160-
161-
# - name: Install build deps
162-
# shell: bash -l {0}
163-
# run: |
164-
# git config --global --add safe.directory '*'
165-
# conda install anaconda-client rattler-build python=${{ matrix.python-version }} -c conda-forge
166-
# pip install versioneer==0.28 toml pyyaml
167-
168-
# - name: Build conda package
169-
# shell: bash -l {0}
170-
# run: |
171-
# python package/moleculekit/insert_placeholder_values.py
172-
# rattler-build build --recipe ./package/moleculekit/recipe.yaml --output-dir ../pkg/ --no-include-recipe -c acellera -c conda-forge
173-
174-
# - name: Upload to conda
175-
# shell: bash -l {0}
176-
# run: |
177-
# anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera ../pkg/*/moleculekit-*.conda
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: ["ubuntu-latest", "macos-latest", "macos-13", "windows-2019"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12"]
14+
15+
defaults: # Needed for conda
16+
run:
17+
shell: bash -l {0}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
lfs: true
23+
submodules: true
24+
25+
- uses: conda-incubator/setup-miniconda@v3
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
channels: acellera,conda-forge,defaults
29+
30+
- name: Lint with flake8
31+
run: |
32+
pip install flake8 coverage pytest-cov pytest pytest-subtests
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
38+
- name: Install moleculekit conda deps
39+
run: |
40+
conda install -y -q --file extra_requirements.txt python=${{ matrix.python-version }} -c acellera -c conda-forge
41+
# scikit-learn, joblib, biopython are only used for rarely-used functions in smallmol
42+
conda install -y -q scikit-learn joblib biopython -c conda-forge
43+
44+
# - name: Install cdpkit
45+
# # if: ${{ matrix.os == 'ubuntu-latest' }}
46+
# run: |
47+
# # for testing CDPKit SmallMol
48+
# pip install CDPKit
49+
50+
- name: Install moleculekit
51+
run: |
52+
pip install "numpy>=1.23.5" "Cython>=0.29.21"
53+
pip install .
54+
pip install "versioneer==0.28"
55+
python setup.py build_ext --inplace
56+
57+
- name: List conda environment
58+
run: conda list
59+
60+
- name: Test
61+
run: |
62+
pytest ./moleculekit
63+
env:
64+
GITHUB_ACTIONS: 1
65+
66+
# - name: Upload coverage to Codecov
67+
# uses: codecov/codecov-action@v3
68+
69+
deploypypi:
70+
if: startsWith(github.event.ref, 'refs/tags/')
71+
needs: test
72+
runs-on: ${{ matrix.os }}
73+
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
os: ["ubuntu-latest"]
78+
python-version: ["3.10"]
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- uses: conda-incubator/setup-miniconda@v3
84+
with:
85+
activate-environment: deploy
86+
python-version: ${{ matrix.python-version }}
87+
88+
- name: Build PyPI 📦
89+
run: |
90+
pip install numpy>=1.23.5 Cython>=0.29.21 build
91+
python -m build --sdist --outdir dist/ .
92+
93+
- name: Publish distribution 📦 to PyPI
94+
uses: pypa/gh-action-pypi-publish@release/v1
95+
with:
96+
password: ${{ secrets.PUBLIC_PYPI_API_TOKEN }}
97+
skip_existing: true
98+
99+
deploy_linux:
100+
if: startsWith(github.event.ref, 'refs/tags/')
101+
needs: test
102+
runs-on: ${{ matrix.os }}
103+
container: ${{ matrix.container }}
104+
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
os: ["ubuntu-latest"]
109+
python-version: ["3.10"]
110+
container: ["quay.io/pypa/manylinux_2_28_x86_64"]
111+
112+
steps:
113+
- uses: actions/checkout@v4
114+
115+
- uses: conda-incubator/setup-miniconda@v2
116+
with:
117+
miniconda-version: "latest"
118+
activate-environment: ../deploy-env
119+
python-version: ${{ matrix.python-version }}
120+
121+
- name: Install build deps
122+
shell: bash -l {0}
123+
run: |
124+
git config --global --add safe.directory '*'
125+
conda install anaconda-client rattler-build python=${{ matrix.python-version }} -c conda-forge
126+
pip install versioneer==0.28 toml pyyaml
127+
128+
- name: Build conda package
129+
shell: bash -l {0}
130+
run: |
131+
python package/moleculekit/insert_placeholder_values.py
132+
rattler-build build --recipe ./package/moleculekit/recipe.yaml --output-dir ../pkg/ --no-include-recipe -c acellera -c conda-forge
133+
134+
- name: Upload to conda
135+
shell: bash -l {0}
136+
run: |
137+
anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera ../pkg/*/moleculekit-*.conda
138+
139+
deploy_osx:
140+
if: startsWith(github.event.ref, 'refs/tags/')
141+
needs: test
142+
runs-on: ${{ matrix.os }}
143+
144+
strategy:
145+
fail-fast: false
146+
matrix:
147+
os: ["macos-latest", "macos-13"]
148+
python-version: ["3.10"]
149+
150+
steps:
151+
- uses: actions/checkout@v4
152+
153+
- uses: ilammy/msvc-dev-cmd@v1
154+
155+
- uses: conda-incubator/setup-miniconda@v3
156+
with:
157+
miniconda-version: "latest"
158+
activate-environment: ../deploy-env
159+
python-version: ${{ matrix.python-version }}
160+
161+
- name: Install build deps
162+
shell: bash -l {0}
163+
run: |
164+
git config --global --add safe.directory '*'
165+
conda install anaconda-client rattler-build python=${{ matrix.python-version }} -c conda-forge
166+
pip install versioneer==0.28 toml pyyaml
167+
168+
- name: Build conda package
169+
shell: bash -l {0}
170+
run: |
171+
python package/moleculekit/insert_placeholder_values.py
172+
rattler-build build --recipe ./package/moleculekit/recipe.yaml --output-dir ../pkg/ --no-include-recipe -c acellera -c conda-forge
173+
174+
- name: Upload to conda
175+
shell: bash -l {0}
176+
run: |
177+
anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera ../pkg/*/moleculekit-*.conda
178178
179179
windows_build:
180+
if: startsWith(github.event.ref, 'refs/tags/')
181+
needs: test
180182
runs-on: ${{ matrix.os }}
181183

182184
strategy:
@@ -210,3 +212,8 @@ jobs:
210212
run: |
211213
python package/moleculekit/insert_placeholder_values.py
212214
rattler-build build --recipe ./package/moleculekit/recipe.yaml --output-dir ../pkg/ --no-include-recipe -c acellera -c conda-forge
215+
216+
- name: Upload to conda
217+
shell: bash -l {0}
218+
run: |
219+
anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera ../pkg/*/moleculekit-*.conda

0 commit comments

Comments
 (0)