Skip to content

Commit 56cb01a

Browse files
committed
extend github workflows with build with clang
1 parent f31e883 commit 56cb01a

File tree

4 files changed

+139
-0
lines changed

4 files changed

+139
-0
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
day: "saturday"
8+
rebase-strategy: "disabled"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build project with IntelLLVM clang compiler
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
permissions: read-all
9+
10+
jobs:
11+
build-with-clang:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
python: ["3.9", "3.10", "3.11", "3.12"]
17+
numpy_version: ["numpy'<2'", "numpy'>=2'"]
18+
env:
19+
ONEAPI_ROOT: /opt/intel/oneapi
20+
21+
steps:
22+
- name: Cancel Previous Runs
23+
uses: styfle/cancel-workflow-action@0.12.1
24+
with:
25+
access_token: ${{ github.token }}
26+
27+
- name: Add Intel repository
28+
run: |
29+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
30+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
31+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
32+
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
33+
sudo apt-get update
34+
35+
- name: Install Intel OneAPI
36+
run: |
37+
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
38+
sudo apt-get install intel-oneapi-tbb
39+
sudo apt-get install intel-oneapi-mkl-devel
40+
41+
- name: Setup Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: ${{ matrix.python }}
45+
architecture: x64
46+
47+
- name: Checkout repo
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
52+
- name: Install mkl_fft dependencies
53+
shell: bash -l {0}
54+
run: |
55+
pip install cython setuptools">=77"
56+
pip install ${{ matrix.numpy_version }}
57+
58+
- name: List oneAPI folder content
59+
shell: bash -l {0}
60+
run: ls /opt/intel/oneapi/compiler
61+
62+
- name: Build mkl_fft
63+
shell: bash -l {0}
64+
run: |
65+
source /opt/intel/oneapi/setvars.sh
66+
echo $CMPLR_ROOT
67+
export CC=$CMPLR_ROOT/bin/icx
68+
export CXX=$CMPLR_ROOT/bin/icpx
69+
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
70+
pip install -e . --no-build-isolation --no-deps --verbose
71+
72+
- name: Run mkl_fft tests
73+
shell: bash -l {0}
74+
run: |
75+
source /opt/intel/oneapi/setvars.sh
76+
pip install pytest scipy mkl-service
77+
pytest -s -v --pyargs mkl_fft

.github/workflows/conda-package-cf.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -43,8 +49,10 @@ jobs:
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 with NumPy 2.0
4957
run: |
5058
CHANNELS="-c conda-forge --override-channels"
@@ -56,6 +64,7 @@ jobs:
5664
$VERSIONS \
5765
$CHANNELS \
5866
conda-recipe-cf
67+
5968
- name: Upload artifact
6069
uses: actions/upload-artifact@v4
6170
with:
@@ -81,10 +90,13 @@ jobs:
8190
uses: actions/download-artifact@v4
8291
with:
8392
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python_ver }}
93+
8494
- name: Add conda to system path
8595
run: echo $CONDA/bin >> $GITHUB_PATH
96+
8697
- name: Install conda-build
8798
run: conda install conda-build
99+
88100
- name: Create conda channel
89101
run: |
90102
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
@@ -97,11 +109,14 @@ jobs:
97109
run: |
98110
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
99111
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME python=${{ matrix.python_ver }} ${{ matrix.numpy }} $CHANNELS --only-deps --dry-run > lockfile
112+
100113
- name: Display lockfile
101114
run: cat lockfile
115+
102116
- name: Set pkgs_dirs
103117
run: |
104118
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
119+
105120
- name: Cache conda packages
106121
uses: actions/cache@v4
107122
env:
@@ -120,6 +135,7 @@ jobs:
120135
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python_ver }} ${{ matrix.numpy }} $PACKAGE_NAME pytest scipy $CHANNELS
121136
# Test installed packages
122137
conda list -n ${{ env.TEST_ENV_NAME }}
138+
123139
- name: Run tests
124140
run: |
125141
source $CONDA/etc/profile.d/conda.sh
@@ -133,9 +149,15 @@ jobs:
133149
matrix:
134150
python: ['3.9', '3.10', '3.11', '3.12']
135151
steps:
152+
- name: Cancel Previous Runs
153+
uses: styfle/cancel-workflow-action@0.12.1
154+
with:
155+
access_token: ${{ github.token }}
156+
136157
- uses: actions/checkout@v4
137158
with:
138159
fetch-depth: 0
160+
139161
- uses: conda-incubator/setup-miniconda@v3
140162
with:
141163
miniforge-version: latest
@@ -181,6 +203,7 @@ jobs:
181203
defaults:
182204
run:
183205
shell: cmd /C CALL {0}
206+
184207
strategy:
185208
matrix:
186209
python_ver: ['3.9', '3.10', '3.11', '3.12']
@@ -227,9 +250,11 @@ jobs:
227250
shell: cmd /C CALL {0}
228251
run: |
229252
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
253+
230254
- name: Output content of produced ver.json
231255
shell: pwsh
232256
run: Get-Content -Path ${{ env.workdir }}\ver.json
257+
233258
- name: Collect dependencies
234259
shell: cmd /C CALL {0}
235260
run: |
@@ -242,9 +267,11 @@ jobs:
242267
SET PACKAGE_VERSION=%%F
243268
)
244269
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python_ver }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
270+
245271
- name: Display lockfile content
246272
shell: pwsh
247273
run: Get-Content -Path .\lockfile
274+
248275
- name: Cache conda packages
249276
uses: actions/cache@v4
250277
env:
@@ -256,6 +283,7 @@ jobs:
256283
restore-keys: |
257284
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_ver }}-
258285
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
286+
259287
- name: Install mkl_fft
260288
shell: cmd /C CALL {0}
261289
run: |
@@ -269,12 +297,14 @@ jobs:
269297
)
270298
SET "TEST_DEPENDENCIES=pytest pytest-cov"
271299
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
300+
272301
- name: Report content of test environment
273302
shell: cmd /C CALL {0}
274303
run: |
275304
echo "Value of CONDA enviroment variable was: " %CONDA%
276305
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
277306
conda info && conda list -n ${{ env.TEST_ENV_NAME }}
307+
278308
- name: Run tests
279309
shell: cmd /C CALL {0}
280310
run: >-

.github/workflows/conda-package.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -43,8 +49,10 @@ jobs:
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"
@@ -56,6 +64,7 @@ jobs:
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

Comments
 (0)