Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mfep committed Sep 12, 2023
1 parent e1d4883 commit e324384
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 71 deletions.
154 changes: 83 additions & 71 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
--binary clang-format

linux:
if: false
runs-on: ubuntu-latest
needs: format
defaults:
Expand All @@ -39,62 +40,62 @@ jobs:
STD: [99, 11, 17]
CONF:
- GEN: Unix Makefiles
CONFIG: Debug
CONFIG: Debug
- GEN: Unix Makefiles
CONFIG: Release
CONFIG: Release
- GEN: Ninja Multi-Config
CONFIG: Release
IMAGE:
- streamhpc/opencl-sdk-intelcpu:ubuntu-22.04-20230717
include:
- CMAKE: system
C_COMPILER: gcc-9
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Debug
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Release
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 32
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Debug
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 32
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Release
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-11
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Debug
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-22.04-20230717
- CMAKE: system
C_COMPILER: gcc-11
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Release
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-22.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Debug
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Release
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 32
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Debug
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-9
BIN: 32
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Release
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-20.04-20230717
- CMAKE: system
C_COMPILER: gcc-11
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Debug
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-22.04-20230717
- CMAKE: system
C_COMPILER: gcc-11
BIN: 64
STD: 99
CONF:
GEN: Unix Makefiles
CONFIG: Release
IMAGE: streamhpc/opencl-sdk-intelcpu:ubuntu-22.04-20230717
container: ${{matrix.IMAGE}}
env:
CMAKE_EXE: /opt/Kitware/CMake/${{ matrix.CMAKE }}/bin/cmake
Expand Down Expand Up @@ -238,18 +239,18 @@ jobs:
shell: pwsh
strategy:
matrix:
VER: [v141, v142, v143, clangcl]
GEN: [Visual Studio 17 2022, Ninja Multi-Config]
VER: [v141] #, v142, v143, clangcl]
GEN: [Visual Studio 17 2022] #, Ninja Multi-Config]
BIN: [x64]
STD: [99, 11, 17]
STD: [99] #, 11, 17]
exclude:
- VER: clangcl
GEN: Ninja Multi-Config
include:
- VER: v142
GEN: Visual Studio 17 2022
BIN: x86
STD: 99
# include:
# - VER: v142
# GEN: Visual Studio 17 2022
# BIN: x86
# STD: 99
env:
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip
NINJA_ROOT: C:\Tools\Ninja
Expand Down Expand Up @@ -382,7 +383,9 @@ jobs:
-- `
/verbosity:minimal `
/maxCpuCount `
/noLogo `
/noLogo
& cd ${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare
& ctest --output-on-failure -C $Config
}
- name: "Consume (Ninja Multi-Config standalone): Configure/Build/Test"
Expand All @@ -408,9 +411,9 @@ jobs:
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare" `
--config ${Config} `
-- `
-j ${env:NUMBER_OF_PROCESSORS} `
--config ${Config}
& cd ${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare
& ctest --output-on-failure -C $Config
}
- name: Consume (Emulate SDK presence)
Expand All @@ -433,13 +436,15 @@ jobs:
-S "${env:GITHUB_WORKSPACE}\tests\pkgconfig\sdk" `
-B "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk"
foreach ($Config in 'Release','Debug') { `
& cmake `
cmake `
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk" `
--config ${Config} `
-- `
/verbosity:minimal `
/maxCpuCount `
/noLogo `
/noLogo
& cd ${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk
& ctest --output-on-failure -C $Config
}
- name: "Consume (Ninja-Multi-Config SDK): Configure/Build/Test"
Expand Down Expand Up @@ -467,10 +472,13 @@ jobs:
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk" `
--config ${Config} `
-- `
-j ${env:NUMBER_OF_PROCESSORS} `
-j ${env:NUMBER_OF_PROCESSORS}
& cd ${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk
& ctest --output-on-failure -C $Config
}
macos:
if: false
runs-on: macos-latest
needs: format
defaults:
Expand Down Expand Up @@ -501,10 +509,9 @@ jobs:

- name: Create Build Environment
run: |
cmake -E make_directory $GITHUB_WORKSPACE/build;
cmake -E make_directory $GITHUB_WORKSPACE/install;
if [[ "${{matrix.GEN}}" == "Ninja Multi-Config" && ! `which ninja` ]]; then brew install ninja; fi;
# Install Ninja only if it's the selected generator and it's not available.
if [[ "${{matrix.GEN}}" == "Ninja Multi-Config" && ! `which ninja` ]]; then brew install ninja; fi;
if [[ ! `which pkg-config` ]]; then brew install pkg-config; fi &&
cmake --version
- name: Configure
Expand Down Expand Up @@ -544,13 +551,18 @@ jobs:
cmake --build $GITHUB_WORKSPACE/build_install --config Release --parallel `sysctl -n hw.logicalcpu` &&
cmake --build $GITHUB_WORKSPACE/build_install --config Debug --parallel `sysctl -n hw.logicalcpu`

- name: Test pkg-config
- name: Run consume test (install)
working-directory: ${{runner.workspace}}/OpenCL-Headers/build_install
run: |
if [[ ! `which pkg-config` ]]; then brew install pkg-config; fi &&
export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/share/pkgconfig" &&
ctest -C Release --output-on-failure --parallel `sysctl -n hw.logicalcpu`
ctest -C Debug --output-on-failure --parallel `sysctl -n hw.logicalcpu`
- name: Test pkg-config
run: export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/share/pkgconfig" &&
pkg-config OpenCL-Headers --cflags | grep -q "\-I$GITHUB_WORKSPACE/install/include"

android:
if: false
runs-on: ubuntu-latest
needs: format
defaults:
Expand Down
7 changes: 7 additions & 0 deletions tests/pkgconfig/bare/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ target_compile_definitions(${PROJECT_NAME}
PRIVATE
CL_TARGET_OPENCL_VERSION=120
)

include(CTest)

add_test(
NAME ${PROJECT_NAME}
COMMAND ${PROJECT_NAME}
)
13 changes: 13 additions & 0 deletions tests/pkgconfig/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ target_compile_definitions(${PROJECT_NAME}
PRIVATE
CL_TARGET_OPENCL_VERSION=120
)

include(CTest)

add_test(
NAME ${PROJECT_NAME}
COMMAND ${PROJECT_NAME}
)
include(CTest)

add_test(
NAME ${PROJECT_NAME}
COMMAND ${PROJECT_NAME}
)

0 comments on commit e324384

Please sign in to comment.