forked from IntelPython/dpnp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4809ee
commit 96fb78e
Showing
1 changed file
with
38 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,80 +24,24 @@ env: | |
VER_SCRIPT2: "d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))" | ||
|
||
jobs: | ||
build_linux: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
build: | ||
name: Build ['${{ matrix.os }}', python='${{ matrix.python }}'] | ||
|
||
strategy: | ||
matrix: | ||
python: ['3.8', '3.9'] | ||
os: [ubuntu-latest, windows-latest] | ||
include: | ||
- python: '3.10' | ||
os: ubuntu-latest | ||
|
||
env: | ||
conda-pkgs: '/home/runner/conda_pkgs_dir/' | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout DPNP repo | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python }} | ||
miniconda-version: 'latest' | ||
activate-environment: 'build' | ||
use-only-tar-bz2: true | ||
|
||
- name: Store conda paths as envs | ||
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV | ||
|
||
- name: Install conda-build | ||
run: conda install conda-build | ||
|
||
- name: Cache conda packages | ||
uses: actions/[email protected] | ||
env: | ||
CACHE_NUMBER: 1 # Increase to reset cache | ||
with: | ||
path: ${{ env.conda-pkgs }} | ||
key: | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- | ||
- name: Build conda package | ||
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe | ||
|
||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} | ||
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2 | ||
|
||
build_windows: | ||
runs-on: windows-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: cmd /C CALL {0} | ||
|
||
strategy: | ||
matrix: | ||
python: ['3.8', '3.9'] | ||
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }} | ||
|
||
env: | ||
conda-pkgs: 'C:\Users\runneradmin\conda_pkgs_dir\' | ||
continue-on-error: false | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
|
@@ -119,26 +63,31 @@ jobs: | |
activate-environment: 'build' | ||
use-only-tar-bz2: true | ||
|
||
- name: Store conda paths as envs | ||
- if: matrix.os == 'ubuntu-latest' | ||
name: Store conda paths as envs on Linux | ||
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV | ||
|
||
- if: matrix.os == 'windows-latest' | ||
name: Store conda paths as envs on Win | ||
run: | | ||
@echo on | ||
(echo CONDA_BLD=%CONDA_PREFIX%\conda-bld\win-64\) >> %GITHUB_ENV% | ||
- name: Install conda-build | ||
run: conda install conda-build | ||
|
||
- name: Cache conda packages | ||
uses: actions/[email protected] | ||
env: | ||
CACHE_NUMBER: 1 # Increase to reset cache | ||
with: | ||
path: ${{ env.conda-pkgs }} | ||
path: ${{ env.CONDA_PKGS_DIR }} | ||
key: | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- | ||
- name: Install conda-build | ||
run: conda install conda-build | ||
|
||
- name: Build conda package | ||
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe | ||
|
||
|
@@ -149,7 +98,9 @@ jobs: | |
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2 | ||
|
||
test_linux: | ||
needs: build_linux | ||
name: Test ['ubuntu-latest', python='${{ matrix.python }}'] | ||
|
||
needs: build | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -159,7 +110,7 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
python: ['3.8', '3.9'] | ||
python: ['3.8', '3.9', '3.10'] | ||
experimental: [false] | ||
|
||
continue-on-error: ${{ matrix.experimental }} | ||
|
@@ -250,7 +201,9 @@ jobs: | |
working-directory: ${{ env.tests-path }} | ||
|
||
test_windows: | ||
needs: build_windows | ||
name: Test ['windows-latest', python='${{ matrix.python }}'] | ||
|
||
needs: build | ||
|
||
runs-on: windows-latest | ||
|
||
|
@@ -422,61 +375,31 @@ jobs: | |
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }} | ||
working-directory: ${{ env.tests-path }} | ||
|
||
upload_linux: | ||
needs: test_linux | ||
|
||
if: | | ||
(github.repository == 'IntelPython/dpnp') && | ||
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')) | ||
runs-on: ubuntu-latest | ||
upload: | ||
name: Upload ['${{ matrix.os }}', python='${{ matrix.python }}'] | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
needs: [test_linux, test_windows] | ||
|
||
strategy: | ||
matrix: | ||
python: ['3.8', '3.9'] | ||
os: [ubuntu-latest, windows-latest] | ||
include: | ||
- python: '3.10' | ||
os: ubuntu-latest | ||
|
||
steps: | ||
- name: Download artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} | ||
|
||
- name: Setup miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python }} | ||
miniconda-version: 'latest' | ||
activate-environment: 'upload' | ||
runs-on: ${{ matrix.os }} | ||
|
||
- name: Install anaconda-client | ||
run: conda install anaconda-client | ||
|
||
- name: Upload | ||
run: anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2 | ||
env: | ||
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
defaults: | ||
run: | ||
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }} | ||
|
||
upload_windows: | ||
needs: test_windows | ||
continue-on-error: false | ||
|
||
if: | | ||
(github.repository == 'IntelPython/dpnp') && | ||
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')) | ||
runs-on: windows-latest | ||
|
||
defaults: | ||
run: | ||
shell: cmd /C CALL {0} | ||
|
||
strategy: | ||
matrix: | ||
python: ['3.8', '3.9'] | ||
steps: | ||
- name: Download artifact | ||
uses: actions/[email protected] | ||
|