-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (118 loc) · 3.83 KB
/
windows-conda.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: build cythonarrays for Windows
on:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- v[0-9].[0-9]+.[0-9]+
jobs:
build-windows:
runs-on: windows-latest
defaults:
run:
shell: cmd
strategy:
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Setup base conda for Python
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
activate-environment: ""
miniforge-version: latest
channels: conda-forge
env:
TMPDIR: ${{ runner.TEMP }}
CONDA_BLD_PATH: env.TMPDIR
- name: Install dependencies and set channels
run: |
(
mamba install -n base "conda>=23.7" conda-build conda-verify anaconda-client boa twine
mamba create -n test-wheels python=${{ matrix.python-version }} numpy pytest-cov build
mamba create -n test-conda python=${{ matrix.python-version }} numpy pytest-cov
)
- name: build cythonarrays for python version
env:
CONDA_BLD_PATH: ${{ runner.TEMP }}
TMPDIR: ${{ runner.TEMP }}
LIBARCHIVE: C:\Miniconda\Library\bin\archive.dll
run: |
(
conda build --python ${{ matrix.python-version }} --no-test cythonarrays\conda.recipe
conda install -c local -c conda-forge -n test-conda cythonarrays
)
- name: test cythonarrays for python version
env:
CONDA_BLD_PATH: ${{ runner.TEMP }}
TMPDIR: ${{ runner.TEMP }}
run: |
(
mamba activate test-conda
python -m pytest --pyargs cythonarrays
echo "### All tests with conda passed! :rocket:" >> $GITHUB_STEP_SUMMARY
)
- name: Upload package to conda
env:
CONDA_BLD_PATH: ${{ runner.TEMP }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_GITHUBACTION_TOKEN }}
ANACONDA_USERNAME: MaxBo
if: ${{ env.ANACONDA_TOKEN }}
run: |
(
mamba activate base
anaconda -t %ANACONDA_TOKEN% upload --skip-existing --user %ANACONDA_USERNAME% %CONDA_BLD_PATH%\win-64\cythonarrays-*.tar.bz2
)
- name: Build wheel and run tests for cythonarrays
run: |
(
mamba activate test-wheels
cd cythonarrays
echo "build cythonarrays from folder %CD%"
pip install -r requirements.txt
pip install .
python -m pytest --pyargs cythonarrays
python -m build -n .
echo "### All tests with pip passed! :rocket:" >> $GITHUB_STEP_SUMMARY
)
- name: run code coverage
if: ${{ matrix.python-version == '3.12' }}
run: |
(
conda activate test-wheels
cd cythonarrays
pip install -e .
python setup.py build_ext --force --inplace --define CYTHON_TRACE_NOGIL
py.test --cov=src --cov-report xml --pyargs cythonarrays
coverage xml
echo "### Code Coverage checked! :rocket:" >> $GITHUB_STEP_SUMMARY
)
- name: Upload to Codecov
if: ${{ matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cythonarrays/coverage.xml
flags: unittests # optional
fail_ci_if_error: true # optional (default = false)
- name: Publish cythonarrays to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: '__token__'
run: |
(
mamba activate base
twine upload --skip-existing -p ${{ secrets.PYPI_API_TOKEN_CYTHONARRAYS }} cythonarrays\dist\*
)
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
detached: true