11name : ASPIRE Python Pip CI
22
33on :
4- - push
5- - pull_request
4+ pull_request :
5+ types : [opened, synchronize, reopened, ready_for_review]
6+ push :
7+
68
79jobs :
810 check :
@@ -15,26 +17,27 @@ jobs:
1517 python-version : ' 3.7'
1618 - name : Install dependencies
1719 run : |
18- python -m pip install --upgrade pip
1920 pip install tox tox-gh-actions
2021 - name : Run Tox Check
2122 run : tox -e check
2223
2324 build :
2425 needs : check
2526 runs-on : ubuntu-latest
27+ # Run on every code push, but only on review ready PRs
28+ if : ${{ github.event_name == 'push' || github.event.pull_request.draft == false }}
2629 strategy :
2730 matrix :
2831 python-version : ['3.7', '3.8', '3.9', '3.10']
29- pyenv : [stable, dev ]
32+ pyenv : [pip ]
3033 exclude :
31- # Exclude 3.7-stable so we can add pre and post tasks to that environment.
34+ # Exclude 3.7-pip so we can add pre/ post tasks to that environment.
3235 - python-version : ' 3.7'
33- pyenv : stable
36+ pyenv : pip
3437 include :
35- # Re-include 3.7-stable with additional tox tasks.
38+ # Re-include 3.7 with additional tox tasks.
3639 - python-version : ' 3.7'
37- pyenv : stable ,docs
40+ pyenv : pip ,docs
3841
3942
4043 steps :
@@ -45,26 +48,68 @@ jobs:
4548 python-version : ${{ matrix.python-version }}
4649 - name : Install dependencies
4750 run : |
48- python -m pip install --upgrade pip
4951 pip install tox tox-gh-actions
5052 - name : Test with tox
5153 run : tox --skip-missing-interpreters false -e py${{ matrix.python-version }}-${{ matrix.pyenv }}
5254 - name : Upload Coverage to CodeCov
5355 uses : codecov/codecov-action@v3
5456
57+ conda-build :
58+ needs : check
59+ runs-on : ${{ matrix.os }}
60+ # Only run on review ready pull_requests
61+ if : ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
62+ defaults :
63+ run :
64+ shell : bash -el {0}
65+ strategy :
66+ matrix :
67+ os : [ubuntu-latest, ubuntu-20.04, macOS-latest, macOS-11]
68+ backend : [default, openblas]
69+ python-version : ['3.8']
70+ include :
71+ - os : ubuntu-latest
72+ backend : intel
73+ - os : macOS-latest
74+ backend : accelerate
75+ - os : windows-2019
76+ backend : default
5577
56- docs :
78+ steps :
79+ - uses : actions/checkout@v3
80+ - name : Set up Conda ${{ matrix.os }} Python ${{ matrix.python-version }}
81+ uses : conda-incubator/setup-miniconda@v2
82+ with :
83+ auto-update-conda : true
84+ python-version : ${{ matrix.python-version }}
85+ activate-environment : aspire
86+ environment-file : environment-${{ matrix.backend }}.yml
87+ auto-activate-base : false
88+ - name : Complete Install and Log Environment ${{ matrix.os }} Python ${{ matrix.python-version }}
89+ run : |
90+ conda info
91+ conda list
92+ pip install -e ".[dev]"
93+ pip freeze
94+ python -c "import numpy; numpy.show_config()"
95+ - name : Execute Pytest Conda ${{ matrix.os }} Python ${{ matrix.python-version }}
96+ run : |
97+ export OMP_NUM_THREADS=2
98+ # -n runs test in parallel using pytest-xdist
99+ pytest -n2 --durations=50 -s
100+
101+ # Build and Deploy production (master) docs.
102+ docs_deploy :
57103 if : github.ref == 'refs/heads/master'
58104 runs-on : ubuntu-latest
59105 steps :
60106 - uses : actions/checkout@v3
61107 - name : Setup Python
62108 uses : actions/setup-python@v4
63109 with :
64- python-version : ' 3.7 '
110+ python-version : ' 3.8 '
65111 - name : Install Dependencies
66112 run : |
67- python -m pip install --upgrade pip
68113 pip install -e ".[dev]"
69114 - name : Run Sphinx doc build script
70115 env :
@@ -77,11 +122,12 @@ jobs:
77122 ampere_gpu :
78123 needs : check
79124 runs-on : self-hosted
125+ # Run on every code push, but only on review ready PRs
126+ if : ${{ github.event_name == 'push' || github.event.pull_request.draft == false }}
80127 steps :
81128 - uses : actions/checkout@v3
82129 - name : Install dependencies
83130 run : |
84- python -m pip install --upgrade pip
85131 pip install -e ".[dev,gpu_11x]"
86132 - name : Customize config
87133 run : |
@@ -104,3 +150,30 @@ jobs:
104150 ASPIREDIR=${{ env.WORK_DIR }} pytest --durations=50
105151 - name : Cleanup
106152 run : rm -rf ${{ env.WORK_DIR }}
153+
154+ # Build branch's docs and gallery.
155+ docs :
156+ needs : check
157+ runs-on : ubuntu-latest
158+ steps :
159+ - uses : actions/checkout@v3
160+ - name : Setup Python
161+ uses : actions/setup-python@v4
162+ with :
163+ python-version : ' 3.8'
164+ - name : Install Dependencies
165+ run : |
166+ python -m pip install --upgrade pip
167+ pip install -e ".[dev]"
168+ - name : Build Sphinx docs
169+ run : |
170+ make distclean
171+ sphinx-apidoc -f -o ./source ../src -H Modules
172+ make html
173+ working-directory : ./docs
174+ - name : Archive Sphinx docs
175+ uses : actions/upload-artifact@v3
176+ with :
177+ name : sphinx-docs
178+ path : docs/build
179+ retention-days : 7
0 commit comments