@@ -4,10 +4,14 @@ on: push
4
4
5
5
env :
6
6
PACKAGE_NAME : dpctl
7
+ MODULE_NAME : dpctl
7
8
8
9
jobs :
9
10
build :
10
11
runs-on : ubuntu-latest
12
+ strategy :
13
+ matrix :
14
+ python : ["3.8"]
11
15
steps :
12
16
- uses : actions/checkout@v2
13
17
with :
23
27
with :
24
28
path : ~/.conda/pkgs
25
29
key :
26
- ${{ runner.os }}-conda-build-${{ env.CACHE_NUMBER }}-${{hashFiles('**/meta.yaml') }}
30
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
31
+ restore-keys : |
32
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
33
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
27
34
28
35
- name : Add conda to system path
29
36
run : echo $CONDA/bin >> $GITHUB_PATH
32
39
- name : Build conda package
33
40
run : |
34
41
CHANNELS="-c intel -c defaults --override-channels"
35
- VERSIONS="--python 3.8 "
42
+ VERSIONS="--python ${{ matrix.python }} "
36
43
TEST="--no-test"
37
44
38
45
conda build \
@@ -43,17 +50,24 @@ jobs:
43
50
- name : Upload artifact
44
51
uses : actions/upload-artifact@v2
45
52
with :
46
- name : ${{ env.PACKAGE_NAME }} ${{ runner.os }}
53
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
47
54
path : /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
48
55
49
56
test :
50
57
needs : build
51
58
runs-on : ubuntu-latest
59
+
60
+ strategy :
61
+ matrix :
62
+ python : ["3.8"]
63
+ env :
64
+ CHANNELS : -c intel -c defaults --override-channels
65
+
52
66
steps :
53
67
- name : Download artifact
54
68
uses : actions/download-artifact@v2
55
69
with :
56
- name : ${{ env.PACKAGE_NAME }} ${{ runner.os }}
70
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
57
71
- name : Add conda to system path
58
72
run : echo $CONDA/bin >> $GITHUB_PATH
59
73
- name : Install conda-build
@@ -65,10 +79,11 @@ jobs:
65
79
conda index $GITHUB_WORKSPACE/channel
66
80
# Test channel
67
81
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels
82
+
68
83
- name : Collect dependencies
69
84
run : |
70
- CHANNELS="-c $GITHUB_WORKSPACE/channel -c intel -c defaults --override-channels "
71
- conda install $PACKAGE_NAME $CHANNELS --only-deps --dry-run > lockfile
85
+ CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }} "
86
+ conda install $PACKAGE_NAME python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
72
87
- name : Set pkgs_dirs
73
88
run : |
74
89
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
@@ -79,28 +94,35 @@ jobs:
79
94
with :
80
95
path : ~/.conda/pkgs
81
96
key :
82
- ${{ runner.os }}-conda-test-${{ env.CACHE_NUMBER }}-${{hashFiles('lockfile') }}
83
- - name : Install ${{ env.PACKAGE_NAME }}
97
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
98
+ restore-keys : |
99
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
100
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
101
+
102
+ - name : Install dpctl
84
103
run : |
85
- CHANNELS="-c $GITHUB_WORKSPACE/channel -c intel -c defaults --override-channels "
86
- conda install $PACKAGE_NAME pytest $CHANNELS
104
+ CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }} "
105
+ conda install $PACKAGE_NAME pytest python=${{ matrix.python }} $CHANNELS
87
106
# Test installed packages
88
107
conda list
89
108
- name : Run tests
90
109
run : |
91
110
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
92
111
export OCL_ICD_FILENAMES=libintelocl.so
93
- python -m pytest --pyargs $PACKAGE_NAME
112
+ python -m pytest --pyargs $MODULE_NAME
94
113
95
114
upload :
96
115
needs : test
97
116
if : ${{ github.ref == 'refs/heads/master' }}
98
117
runs-on : ubuntu-latest
118
+ strategy :
119
+ matrix :
120
+ python : ["3.8"]
99
121
steps :
100
122
- name : Download artifact
101
123
uses : actions/download-artifact@v2
102
124
with :
103
- name : ${{ env.PACKAGE_NAME }} ${{ runner.os }}
125
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
104
126
105
127
- name : Install anaconda-client
106
128
run : conda install anaconda-client
0 commit comments