@@ -22,13 +22,19 @@ jobs:
2222 matrix :
2323 python : ['3.9', '3.10', '3.11', '3.12']
2424 steps :
25+ - name : Cancel Previous Runs
26+ uses : styfle/cancel-workflow-action@0.12.1
27+ with :
28+ access_token : ${{ github.token }}
29+
2530 - uses : actions/checkout@v4
2631 with :
2732 fetch-depth : 0
2833
2934 - name : Set pkgs_dirs
3035 run : |
3136 echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
37+
3238 - name : Cache conda packages
3339 uses : actions/cache@v4
3440 env :
4349
4450 - name : Add conda to system path
4551 run : echo $CONDA/bin >> $GITHUB_PATH
52+
4653 - name : Install conda-build
4754 run : conda install conda-build
55+
4856 - name : Build conda package
4957 run : |
5058 CHANNELS="-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels"
5664 $VERSIONS \
5765 $CHANNELS \
5866 conda-recipe
67+
5968 - name : Upload artifact
6069 uses : actions/upload-artifact@v4
6170 with :
@@ -80,10 +89,13 @@ jobs:
8089 uses : actions/download-artifact@v4
8190 with :
8291 name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
92+
8393 - name : Add conda to system path
8494 run : echo $CONDA/bin >> $GITHUB_PATH
95+
8596 - name : Install conda-build
8697 run : conda install conda-build
98+
8799 - name : Create conda channel
88100 run : |
89101 mkdir -p $GITHUB_WORKSPACE/channel/linux-64
@@ -96,11 +108,14 @@ jobs:
96108 run : |
97109 CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
98110 conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
111+
99112 - name : Display lockfile
100113 run : cat lockfile
114+
101115 - name : Set pkgs_dirs
102116 run : |
103117 echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
118+
104119 - name : Cache conda packages
105120 uses : actions/cache@v4
106121 env :
@@ -119,6 +134,7 @@ jobs:
119134 conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} $PACKAGE_NAME pytest scipy $CHANNELS
120135 # Test installed packages
121136 conda list -n ${{ env.TEST_ENV_NAME }}
137+
122138 - name : Run tests
123139 run : |
124140 source $CONDA/etc/profile.d/conda.sh
@@ -132,9 +148,15 @@ jobs:
132148 matrix :
133149 python : ['3.9', '3.10', '3.11', '3.12']
134150 steps :
151+ - name : Cancel Previous Runs
152+ uses : styfle/cancel-workflow-action@0.12.1
153+ with :
154+ access_token : ${{ github.token }}
155+
135156 - uses : actions/checkout@v4.2.0
136157 with :
137158 fetch-depth : 0
159+
138160 - uses : conda-incubator/setup-miniconda@v3
139161 with :
140162 miniforge-version : latest
@@ -182,6 +204,7 @@ jobs:
182204 defaults :
183205 run :
184206 shell : cmd /C CALL {0}
207+
185208 strategy :
186209 matrix :
187210 python : ['3.9', '3.10', '3.11', '3.12']
@@ -197,6 +220,7 @@ jobs:
197220 uses : actions/download-artifact@v4
198221 with :
199222 name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
223+
200224 - uses : conda-incubator/setup-miniconda@v3
201225 with :
202226 miniforge-version : latest
@@ -226,9 +250,11 @@ jobs:
226250 shell : cmd /C CALL {0}
227251 run : |
228252 conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
253+
229254 - name : Output content of produced ver.json
230255 shell : pwsh
231256 run : Get-Content -Path ${{ env.workdir }}\ver.json
257+
232258 - name : Collect dependencies
233259 shell : cmd /C CALL {0}
234260 run : |
@@ -241,9 +267,11 @@ jobs:
241267 SET PACKAGE_VERSION=%%F
242268 )
243269 conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
270+
244271 - name : Display lockfile content
245272 shell : pwsh
246273 run : Get-Content -Path .\lockfile
274+
247275 - name : Cache conda packages
248276 uses : actions/cache@v4
249277 env :
@@ -255,6 +283,7 @@ jobs:
255283 restore-keys : |
256284 ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
257285 ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
286+
258287 - name : Install mkl_fft
259288 shell : cmd /C CALL {0}
260289 run : |
@@ -268,6 +297,7 @@ jobs:
268297 )
269298 SET "TEST_DEPENDENCIES=pytest pytest-cov"
270299 conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
300+
271301 - name : Report content of test environment
272302 shell : cmd /C CALL {0}
273303 run : |
0 commit comments