Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI, CD #88

Merged
merged 42 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9f512a1
Add DEB packaging
Beanavil Jul 6, 2024
b6a010f
Update check-format script
Beanavil Jul 6, 2024
00c3656
Android build in CI
mfep Jul 6, 2024
fb69fd5
Add linux CI
Beanavil Jul 6, 2024
ad728d8
Remove the C headers, C++ headers and loader from the SDK deb package
Beanavil Jul 6, 2024
6c4ff26
Submodules update
Beanavil Jul 6, 2024
d3dee18
Add Windows CI job
Beanavil Jul 6, 2024
42c576f
Add MacOS CI job
Beanavil Jul 6, 2024
38e75c8
Unify C/C++ standards
Beanavil Jul 6, 2024
3de17f6
Fix warnings and errors gcc
Beanavil Jul 6, 2024
877ceb6
Fix warnings and errors clang
Beanavil Jul 6, 2024
1416b55
Fix multi-config
Beanavil Jul 6, 2024
7efdb4b
Fix MacOS errors
Beanavil Jul 6, 2024
60734a3
Fix Windows errors
Beanavil Jul 6, 2024
d6b6083
Install Windows OpenCL runtime
Beanavil Jul 6, 2024
3857d95
Fix blur/blurcpp samples failures
Beanavil Jul 6, 2024
73b7760
Fix MacOS test execution
Beanavil Jul 6, 2024
13870bd
Fixed blur/blucpp OpenCL 2.0 check
Beanavil Jul 6, 2024
94f6c33
Various minor improvements
mfep Jul 6, 2024
3949508
Updated release scripts
mfep Jul 6, 2024
69ab367
Building and packaging clinfo
mfep Jul 6, 2024
6150a46
Minor fixes and improvements
mfep Jul 6, 2024
6c3b05f
Removed ToDos
mfep Jul 6, 2024
34e6004
Updated RELEASE.md
mfep Jul 6, 2024
bb326d2
Removed _get_platform(cl_platform_id platform) from mako
mfep Jul 6, 2024
6ae062f
Fixed resource release bug in binaries sample
mfep Jul 6, 2024
496dd19
Remove null pointer checks
Beanavil Jul 6, 2024
df2de29
Re-added whereami
mfep Jul 6, 2024
36afd8a
Using upstream main for OpenCL-Headers submodule
mfep Jul 6, 2024
df8bfb5
Bump deprecated actions
mfep Jul 6, 2024
548a2ad
Removed MSVC++ v141 jobs
mfep Jul 6, 2024
998a83a
Whereami workaround
mfep Jul 6, 2024
0e91876
fix(ci): Fetch a newer version of SFML, update patch
mfep Jul 6, 2024
a92fc0f
fix(ci): Set up OSX architecture
mfep Jul 6, 2024
ffd0299
fix(binaries): Sample lang in binary name
mfep Jul 6, 2024
c288f50
fix(ci): Fixed system deps in Linux builds
mfep Jul 6, 2024
515c7d7
Update docker images
Beanavil Jul 6, 2024
546cbc8
Fix MSVC compiler toolset version
Beanavil Jul 6, 2024
6d72f77
Removed OpenCL 2.0 check and cl_khr_subgroups from blur sample
Beanavil Jul 6, 2024
1612384
Fixed compiler options being reset
Beanavil Jul 6, 2024
2d51805
Bumped version of pocl
Beanavil Jul 6, 2024
ef49e76
Updated submodules' repository URL
Beanavil Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
833 changes: 756 additions & 77 deletions .github/workflows/presubmit.yml

Large diffs are not rendered by default.

163 changes: 127 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,26 @@ name: Create Release
jobs:
windows-binary:
runs-on: windows-2022
defaults:
run:
shell: pwsh
strategy:
matrix:
VER: [v143]
GEN: [Visual Studio 17 2022]
BIN: [x64, x86]

env:
UseMultiToolTask: true
EnforceProcessCountAcrossBuilds: true
MultiProcMaxCount: 3
steps:
- name: Checkout OpenCL-SDK
uses: actions/checkout@v2

- name: Initialize git submodules
shell: pwsh
run: |
& git submodule init
& git submodule update

- name: Create Build Environment
shell: pwsh
run: |
# Parallelize MSBuild across projects
[Environment]::SetEnvironmentVariable('UseMultiToolTask', 'true', [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable('EnforceProcessCountAcrossBuilds', 'true', [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable('MultiProcMaxCount', "$env:NUMBER_OF_PROCESSORS", [EnvironmentVariableTarget]::User)
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Configure
shell: pwsh
run: |
$Bin = if('${{matrix.BIN}}' -eq 'x86') {'Win32'} else {'x64'}
& cmake `
Expand All @@ -42,15 +36,16 @@ jobs:
-T ${{matrix.VER}} `
-S "${env:GITHUB_WORKSPACE}" `
-B "${env:GITHUB_WORKSPACE}\build" `
-D CMAKE_INSTALL_PREFIX="${env:GITHUB_WORKSPACE}\install" `
-D BUILD_DOCS=OFF `
-D BUILD_TESTING=OFF `
-D BUILD_EXAMPLES=OFF `
-D OPENCL_SDK_BUILD_SAMPLES=OFF `
-D OPENCL_ICD_LOADER_BUILD_TESTING=OFF `
-D CMAKE_POLICY_DEFAULT_CMP0096=NEW
if ($LASTEXITCODE -ne 0) { throw "Configuring OpenCL-SDK failed." }

- name: Check version number
shell: pwsh
run: |
if ( -not (`
Get-Content ${env:GITHUB_WORKSPACE}\build\CMakeCache.txt | `
Expand All @@ -59,30 +54,29 @@ jobs:
{ throw 'CMake project version mismatches Git tag name (without leading "v")'}

- name: Build
shell: pwsh
run: |
foreach ($Config in "Debug","Release") { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\build" `
--config $Config `
-- `
/verbosity:minimal `
/noLogo `
/noLogo
if ($LASTEXITCODE -ne 0) { throw "Building OpenCL-SDK in $Config failed." }
}

- name: Package Binary
shell: pwsh
run: |
& cpack `
--config "${env:GITHUB_WORKSPACE}\build\CPackConfig.cmake" `
-G ZIP `
-C 'Debug;Release' `
-D CPACK_PACKAGE_FILE_NAME='OpenCL-SDK-${{github.ref_name}}-Win-${{matrix.BIN}}' `
-B "${env:GITHUB_WORKSPACE}\package"
if ($LASTEXITCODE -ne 0) { throw "Packaging OpenCL-SDK failed." }

- name: Upload Package
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
Expand All @@ -91,22 +85,24 @@ jobs:
source:
name: Source Release (${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
strategy:
matrix:
OS: [ubuntu-20.04, windows-2022]

env:
DEB_INSTALLATION_PATH: /usr

steps:
- name: Checkout OpenCL-SDK
uses: actions/checkout@v2

- name: Initialize git submodules
shell: pwsh
run: |
& git submodule init
& git submodule update
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Configure
shell: pwsh
run: |
& cmake `
-S "${env:GITHUB_WORKSPACE}" `
Expand All @@ -116,19 +112,29 @@ jobs:
-D BUILD_EXAMPLES=OFF `
-D OPENCL_SDK_BUILD_SAMPLES=OFF `
-D OPENCL_ICD_LOADER_BUILD_TESTING=OFF `
-D CMAKE_POLICY_DEFAULT_CMP0096=NEW
-D CMAKE_POLICY_DEFAULT_CMP0096=NEW `
-D CPACK_PACKAGING_INSTALL_PREFIX=$DEB_INSTALLATION_PATH
if ($LASTEXITCODE -ne 0) { throw "Configuring OpenCL-SDK failed." }

- name: Check version number
shell: pwsh
run: |
if ( -not (`
Get-Content ${env:GITHUB_WORKSPACE}/build/CMakeCache.txt | `
Select-String -Pattern ('CMAKE_PROJECT_VERSION:STATIC=' + '${{github.ref_name}}'.Replace('v','')) `
)) `
{ throw 'CMake project version mismatches Git tag name (without leading "v")'}

- name: Package DEB
if: ${{ contains(matrix.OS, 'ubuntu') }}
run: |
cpack `
--config "${env:GITHUB_WORKSPACE}/build/CPackSourceConfig.cmake" `
-G DEB `
-C Release `
"${env:GITHUB_WORKSPACE}/package-deb"
if ($LASTEXITCODE -ne 0) { throw "Packaging OpenCL-SDK deb failed." }

- name: Package Source
shell: pwsh
run: |
$Generator = if('${{matrix.OS}}' -match 'windows') {'ZIP'} else {'TGZ'}
& cpack `
Expand All @@ -138,11 +144,96 @@ jobs:
-D CPACK_SOURCE_IGNORE_FILES="/\\.git/;/\\.gitignore;/\\.gitmodules;/\\.gitlab/;/\\.github/;/\\.reuse/;/\\.appveyor.yml;/build/;/install/;/package/" `
-D CPACK_PACKAGE_FILE_NAME='OpenCL-SDK-${{github.ref_name}}-Source' `
-B "${env:GITHUB_WORKSPACE}/package"
if ($LASTEXITCODE -ne 0) { throw "Packaging OpenCL-SDK source failed." }

- name: Release Source
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
package/OpenCL-SDK-${{github.ref_name}}-Source.*
package/OpenCL-SDK-${{github.ref_name}}-Source.*

ppa:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
OPENCL_HEADERS_REPOSITORY: mfep/OpenCL-Headers
OPENCL_ICD_LOADER_REPOSITORY: mfep/OpenCL-ICD-Loader
OPENCL_CLHPP_REPOSITORY: mfep/OpenCL-CLHPP
distroseries: jammy
steps:
- name: Add PPA
run: sudo add-apt-repository -y ppa:${{ vars.PPA }}

- name: Install prerequisites
run: sudo apt-get update -qq && sudo apt-get install -y
cmake
devscripts
debhelper-compat=13
opencl-c-headers
opencl-clhpp-headers
khronos-opencl-loader-libopencl1
khronos-opencl-loader-opencl-dev
clinfo

- name: Import GPG signing key
run: echo "${{ secrets.DEB_SIGNING_KEY }}" | gpg --import

- name: Download and extract source code (OpenCL-SDK)
run: |
wget -O $GITHUB_WORKSPACE/source.orig.tar.gz https://github.com/$GITHUB_REPOSITORY/archive/refs/tags/$GITHUB_REF_NAME.tar.gz
tar -xvf $GITHUB_WORKSPACE/source.orig.tar.gz -C $GITHUB_WORKSPACE
mv $GITHUB_WORKSPACE/OpenCL-SDK-* $GITHUB_WORKSPACE/OpenCL-SDK

- name: Download and extract source code (OpenCL-Headers)
run: |
wget -O $GITHUB_WORKSPACE/opencl-headers.tar.gz https://github.com/$OPENCL_HEADERS_REPOSITORY/archive/refs/tags/$GITHUB_REF_NAME.tar.gz
tar -xvf $GITHUB_WORKSPACE/opencl-headers.tar.gz -C $GITHUB_WORKSPACE/OpenCL-SDK/external
rm -rf $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-Headers
mv $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-Headers-* $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-Headers

- name: Download and extract source code (OpenCL-ICD-Loader)
run: |
wget -O $GITHUB_WORKSPACE/opencl-icd-loader.tar.gz https://github.com/$OPENCL_ICD_LOADER_REPOSITORY/archive/refs/tags/$GITHUB_REF_NAME.tar.gz
tar -xvf $GITHUB_WORKSPACE/opencl-icd-loader.tar.gz -C $GITHUB_WORKSPACE/OpenCL-SDK/external
rm -rf $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-ICD-Loader
mv $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-ICD-Loader-* $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-ICD-Loader

- name: Download and extract source code (OpenCL-CLHPP)
run: |
wget -O $GITHUB_WORKSPACE/opencl-clhpp.tar.gz https://github.com/$OPENCL_CLHPP_REPOSITORY/archive/refs/tags/$GITHUB_REF_NAME.tar.gz
tar -xvf $GITHUB_WORKSPACE/opencl-clhpp.tar.gz -C $GITHUB_WORKSPACE/OpenCL-SDK/external
rm -rf $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-CLHPP
mv $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-CLHPP-* $GITHUB_WORKSPACE/OpenCL-SDK/external/OpenCL-CLHPP

- name: Configure project out-of-tree
run: cmake
-S $GITHUB_WORKSPACE/OpenCL-SDK*
-B $GITHUB_WORKSPACE/../build
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/usr
-D BUILD_TESTING=OFF
-D OPENCL_SDK_BUILD_SAMPLES=OFF
-D LATEST_RELEASE_VERSION=$GITHUB_REF_NAME
-D CPACK_DEBIAN_PACKAGE_MAINTAINER="${{ vars.DEB_MAINTAINER }}"
-D DEBIAN_VERSION_SUFFIX=${{ vars.DEB_VERSION_SUFFIX }}

- name: Generate packaging scripts
run: cmake
-D CMAKE_CACHE_PATH=$GITHUB_WORKSPACE/../build/CMakeCache.txt
-D ORIG_ARCHIVE=$GITHUB_WORKSPACE/source.orig.tar.gz
-D LATEST_RELEASE_VERSION=$GITHUB_REF_NAME
-D DEBIAN_DISTROSERIES=${{ env.distroseries }}
-D DEBIAN_PACKAGE_MAINTAINER="${{ vars.DEB_MAINTAINER }}"
-D DEBIAN_VERSION_SUFFIX=${{ vars.DEB_VERSION_SUFFIX }}
-P $GITHUB_WORKSPACE/OpenCL-SDK*/cmake/DebSourcePkg.cmake

- name: Build source package
run: |
cd $GITHUB_WORKSPACE/OpenCL-SDK*/
debuild -S -sa

- name: Push source package to the PPA
run: dput ppa:${{ vars.PPA }} $GITHUB_WORKSPACE/*source.changes
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
build/
install/
# Build dir
[Bb]uild/

# Install dir
[Ii]nstall/

# Package dirs
[Pp]ackage/
[Pp]ackage-deb/

# Cmake
CMakeFiles/

# vim
*~
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.16)

set(CMAKE_CXX_STANDARD 14)

Expand All @@ -28,6 +28,11 @@ cmake_dependent_option(OPENCL_SDK_BUILD_SAMPLES "Build sample code" ON OPENCL_SD
cmake_dependent_option(OPENCL_SDK_BUILD_OPENGL_SAMPLES "Build OpenCL-OpenGL interop sample code" ON OPENCL_SDK_BUILD_SAMPLES OFF)
cmake_dependent_option(OPENCL_SDK_TEST_SAMPLES "Add CTest to samples (where applicable)" ON OPENCL_SDK_BUILD_SAMPLES OFF)

option(OPENCL_SDK_BUILD_CLINFO "Build clinfo utility" ON)
if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
string(APPEND CMAKE_CXX_FLAGS " -stdlib=libstdc++")
endif()

include(CTest)

if (NOT CMAKE_BUILD_TYPE)
Expand All @@ -48,6 +53,7 @@ list(APPEND CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake/Modules
)
include(Dependencies)
include(Package)
if(OPENCL_SDK_BUILD_UTILITY_LIBRARIES)
add_subdirectory(lib)
endif()
Expand All @@ -71,6 +77,7 @@ set(config_package_location ${CMAKE_INSTALL_DATADIR}/cmake/OpenCL)
install(
FILES ${PROJECT_BINARY_DIR}/OpenCL/OpenCLConfig.cmake
DESTINATION ${config_package_location}
COMPONENT binary
)

unset(CMAKE_SIZEOF_VOID_P)
Expand All @@ -83,6 +90,7 @@ write_basic_package_version_file(
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenCL/OpenCLConfigVersion.cmake
DESTINATION ${config_package_location}
COMPONENT binary
)

include(CPack)
Loading