Skip to content

Commit 20e467d

Browse files
committed
ci: use action for Intel
1 parent 59ebfdc commit 20e467d

File tree

4 files changed

+53
-58
lines changed

4 files changed

+53
-58
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ubuntu:20.04
2+
3+
RUN export DEBIAN_FRONTEND="noninteractive" \
4+
&& apt-get update \
5+
&& apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg \
6+
&& wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB \
7+
&& apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB \
8+
&& echo "deb https://apt.repos.intel.com/oneapi all main" >> /etc/apt/sources.list.d/oneAPI.list \
9+
&& apt-get update \
10+
&& apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-pip python3-numpy python3-pytest \
11+
&& apt-get clean \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
COPY entrypoint.sh /entrypoint.sh
15+
16+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
description: 'Run and test pybind11 on an Intel compiler'
2+
inputs:
3+
cxxstd:
4+
description: 'The version of C++ to use'
5+
required: true
6+
name: 'Check on Intel'
7+
runs:
8+
using: 'docker'
9+
image: 'Dockerfile'
10+
args:
11+
- ${{ inputs.cxxstd }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash -l
2+
3+
cxxstd=$1
4+
source /opt/intel/oneapi/setvars.sh
5+
6+
set -ex
7+
8+
python3 -m pip install --upgrade pip
9+
python3 -m pip install -r tests/requirements.txt --prefer-binary
10+
11+
cmake -S . -B build \
12+
-DPYBIND11_WERROR=ON \
13+
-DDOWNLOAD_CATCH=ON \
14+
-DDOWNLOAD_EIGEN=OFF \
15+
-DCMAKE_CXX_STANDARD=$cxxstd \
16+
-DCMAKE_CXX_COMPILER=$(which icpc) \
17+
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
18+
19+
cmake --build build -j 2
20+
21+
cmake --build build --target check
22+
cmake --build build --target cpptest
23+
cmake --build build --target test_cmake_build

.github/workflows/ci.yml

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -400,64 +400,9 @@ jobs:
400400
steps:
401401
- uses: actions/checkout@v1
402402

403-
- name: Add apt repo
404-
run: |
405-
sudo apt-get update
406-
sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
407-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
408-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
409-
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
410-
411-
- name: Add ICC & Python 3
412-
run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-numpy python3-pytest python3-pip
413-
414-
- name: Update pip
415-
shell: bash
416-
run: |
417-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
418-
python3 -m pip install --upgrade pip
419-
420-
- name: Install dependencies
421-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
422-
python3 -m pip install -r tests/requirements.txt --prefer-binary
423-
424-
- name: Configure
425-
shell: bash
426-
run: |
427-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
428-
cmake -S . -B build \
429-
-DPYBIND11_WERROR=ON \
430-
-DDOWNLOAD_CATCH=ON \
431-
-DDOWNLOAD_EIGEN=OFF \
432-
-DCMAKE_CXX_STANDARD=11 \
433-
-DCMAKE_CXX_COMPILER=$(which icpc) \
434-
-DCMAKE_VERBOSE_MAKEFILE=ON \
435-
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
436-
437-
- name: Build
438-
shell: bash
439-
run: |
440-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
441-
cmake --build build -j 2
442-
443-
- name: Python tests
444-
shell: bash
445-
run: |
446-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
447-
sudo service apport stop
448-
cmake --build build --target check
449-
450-
- name: C++ tests
451-
shell: bash
452-
run: |
453-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
454-
cmake --build build --target cpptest
455-
456-
- name: Interface test
457-
shell: bash
458-
run: |
459-
set +e; source /opt/intel/oneapi/setvars.sh; set -e
460-
cmake --build build --target test_cmake_build
403+
- uses: ./.github/actions/intel-compiler
404+
with:
405+
cxxstd: 11
461406

462407

463408
# Testing on CentOS (manylinux uses a centos base, and this is an easy way

0 commit comments

Comments
 (0)