-
-
Notifications
You must be signed in to change notification settings - Fork 21
143 lines (126 loc) · 4.12 KB
/
test.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
133
134
135
136
137
138
139
140
141
142
143
name: ci-branch-tests
# Bump 4
on: push
concurrency:
group: ada-quick-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
bump:
name: Bump version
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
outputs:
version: ${{ steps.bump.outputs.version }}
conda_bump: ${{ steps.bump.outputs.condabump }}
pypi_bump: ${{ steps.bump.outputs.pypibump }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install bumpyproject
run: pip install git+https://github.com/Krande/bumpyproject.git
- name: Check if current pyproject version is safe for pushing to conda & pypi
id: bump
run: bumpy pyproject --check-current --ga-version-output
env:
CONDA_URL: "https://api.anaconda.org/package/krande/ada-py"
PYPI_URL: "https://pypi.org/pypi/ada-py/json"
- name: echo bump
run: |
echo ${{ steps.bump.outputs.version }}
echo CONDA_BUMP ${{ steps.bump.outputs.condabump }}
echo PYPI_BUMP ${{ steps.bump.outputs.pypibump }}
test-core:
name: Test ada-py-core
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
cache-environment: true
environment-file: conda/environment.core.yml
create-args: >-
python=3.11
pytest
- name: Install latest adapy
run: |
pip install -e .
- name: Runs Tests
run: pytest ./tests --ignore=./tests/docker/ --ignore=./tests/full/
test-full:
name: Test ada-py-full
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
cache-environment: true
environment-file: conda/environment.core.yml
create-args: >-
python=3.11
pytest
jupyterlab
pythreejs
pyparsing
- name: Install latest adapy
run: |
pip install -e .
- name: Run Tests
run: pytest ./tests --ignore=./tests/docker/
# Only if triggered by a tag and passes tests, then publish to pypi and conda
pypi:
needs: [ test-core, test-full, bump ]
if: ${{ startsWith(github.ref, 'refs/tags/') && needs.bump.outputs.pypi_bump == 'TRUE' }}
name: Publish to PYPI
defaults:
run:
shell: bash -l {0}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install deps
run: pip install build
- name: Build and upload package for pypi
run: |
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
conda_upload:
needs: [ test-core, test-full, bump ]
if: ${{ startsWith(github.ref, 'refs/tags/') && needs.bump.outputs.conda_bump == 'TRUE' }}
name: Publish to CONDA
defaults:
run:
shell: bash -l {0}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build: [ { name: 'core' },{ name: 'full' } ]
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
cache-environment: true
environment-file: conda/environment.build.yml
- name: Build & Upload to CONDA Dev
run: |
conda mambabuild -c conda-forge -c krande/label/dev . --variants "{'variant': '${{matrix.build.name}}'}" --user krande --token=${{ secrets.ANACONDA_TOKEN }} --label dev --no-copy-test-source-files --no-test --no-build-id
working-directory: conda
env:
VERSION: ${{ needs.bump.outputs.version }}