-
Notifications
You must be signed in to change notification settings - Fork 70
198 lines (185 loc) · 7.45 KB
/
ccpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: C/C++ CI
on:
push:
branches:
- devel
- master
paths:
- '.github/scripts/**'
- '.github/workflows/ccpp.yml'
- '**.c'
- '**.cpp'
- '**.cu'
- '**.h'
- '**.hpp'
- '**.m'
- '**.mm'
- 'CMakeLists.txt'
- 'libgpujpeg.pc.*'
jobs:
retag-continuous:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, we do not need to create own token.
steps:
- uses: actions/checkout@main
if: github.repository == 'CESNET/GPUJPEG' && github.ref == 'refs/heads/master'
with:
persist-credentials: true
- name: Retag continuous
if: github.repository == 'CESNET/GPUJPEG' && github.ref == 'refs/heads/master'
run: |
git tag -f continuous
git push -f origin refs/tags/continuous:refs/tags/continuous
Ubuntu:
name: run Ubuntu
needs: retag-continuous
runs-on: ubuntu-20.04
strategy:
matrix:
conf: [legacy, all]
include:
- conf: legacy
cuda_arch: 30
tar_name: GPUJPEG-Linux.tar.xz
name: Linux build
- conf: all
cuda_arch: all
tar_name: GPUJPEG-Linux-all.tar.xz
name: Linux build (all CUDA architetures)
steps:
- uses: actions/checkout@main
- name: Install
run: |
sudo apt update
sudo apt install cmake jq
- name: Install disro CUDA
if: matrix.conf == 'legacy'
run: |
sudo apt install nvidia-cuda-toolkit
id: install-distro-cuda
- name: Install NVIDIA-distributed CUDA
if: steps.install-distro-cuda.conclusion == 'skipped'
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/\
ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit
echo CUDACXX=/usr/local/cuda/bin/nvcc >> "$GITHUB_ENV"
- name: Build
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib' \
-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_arch }} -Bbuild .
cmake --build build --parallel
ctest -R unittests
cmake --install build --prefix GPUJPEG
tar caf ${{ matrix.tar_name }} GPUJPEG
- name: Upload Archive
if: github.repository != 'CESNET/GPUJPEG' || github.ref != 'refs/heads/master'
uses: actions/upload-artifact@main
with:
name: GPUJPEG CI ${{ matrix.name }}
path: GPUJPEG
- name: Upload Release Build Asset
if: github.repository == 'CESNET/GPUJPEG' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/replace-asset.sh continuous ${{ matrix.tar_name }}
application/x-gtar "${{ matrix.name }}"
Windows:
name: run Windows
needs: retag-continuous
runs-on: windows-2019
strategy:
matrix:
include:
- conf: legacy
build_filename: GPUJPEG-Windows
cuda_arch: 30
cuda_installer: "https://developer.download.nvidia.com/compute/\
cuda/10.2/Prod/network_installers/cuda_10.2.89_win10_network.exe"
name_prefix: Windows
# - conf: all
# build_filename: GPUJPEG-Windows-all
# cuda_arch: all
# cuda_installer: "https://developer.download.nvidia.com/compute/\
# cuda/12.8.0/network_installers/cuda_12.8.0_windows_network.exe"
# name_prefix: Windows (all CUDA architectures)
steps:
- uses: actions/checkout@main
- name: install CUDA
run: |
#choco install cuda -y --no-progress --version=10.1.243
$installer="${{ matrix.cuda_installer }}"
$installer -match 'cuda_(?<version>[0-9]+.[0-9]+)'
$version=$Matches.version # major.minor (without patch level)
Invoke-WebRequest $installer -OutFile cuda_inst.exe
Start-Process -FilePath "cuda_inst.exe" -ArgumentList "-s cudart_$version nvcc_$version visual_studio_integration_$version" -Wait -NoNewWindow
- name: install NSIS
run: choco install nsis -y --no-progress
- name: install GLFW
run: |
Invoke-WebRequest 'https://github.com/glfw/glfw/releases/download/3.3.3/glfw-3.3.3.bin.win64.zip' -OutFile glfw.zip
Expand-Archive -LiteralPath 'glfw.zip' -DestinationPath 'C:\'
Move-Item 'C:\glfw-3.3.3.bin.WIN64' 'C:\glfw'
- name: install GLEW
run: |
Invoke-WebRequest 'https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip' -OutFile glew.zip
Expand-Archive -LiteralPath 'glew.zip' -DestinationPath 'C:\'
Move-Item 'C:\glew-2.2.0' 'C:\glew'
- name: Build
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
#Set-PSDebug -Trace 1
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
$Env:NVCC_PREPEND_FLAGS="-allow-unsupported-compiler -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH"
# TODO: figure out if setting CMAKE_SYSTEM_VERSION is needed/best solution
cmake.exe -DCMAKE_SYSTEM_VERSION=10.0.18362 -DCMAKE_BUILD_TYPE=Release `
-DBUILD_OPENGL=ON -DGLFW_ROOT_DIR='C:\glfw' -DGLFW_USE_STATIC_LIBS=ON `
-DGLEW_ROOT='C:\glew' -DGLEW_USE_STATIC_LIBS=ON `
-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_arch }} -Bbuild .
cmake.exe --build build --config Release --parallel (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
cmake.exe --install build --prefix GPUJPEG
cpack.exe --config build/CPackConfig.cmake -GNSIS64
Compress-Archive -Path GPUJPEG -DestinationPath GPUJPEG
- name: Upload Archive
if: github.repository != 'CESNET/GPUJPEG' || github.ref != 'refs/heads/master'
uses: actions/upload-artifact@main
with:
name: GPUJPEG CI ${{ matrix.name_prefix }} build
path: GPUJPEG
- name: Upload Installer
if: github.repository != 'CESNET/GPUJPEG' || github.ref != 'refs/heads/master'
uses: actions/upload-artifact@main
with:
name: GPUJPEG CI ${{ matrix.name_prefix }} installer
path: gpujpeg-*-win64.exe
- name: Upload Release Build Asset
if: github.repository == 'CESNET/GPUJPEG' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
fname="${{ matrix.build_filename }}.zip"
mv GPUJPEG.zip "./$fname"
pacman -Sy --noconfirm mingw-w64-x86_64-jq
PATH=/mingw64/bin:$PATH
echo 'PATH=/mingw64/bin:$PATH' >> ~/.bash_profile # store the path also for next step
.github/scripts/replace-asset.sh continuous "$fname"\
application/zip "${{ matrix.name_prefix }} build"
shell: C:\shells\msys2bash.cmd {0}
- name: Upload Release Installer Asset
if: github.repository == 'CESNET/GPUJPEG' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
fname="${{ matrix.build_filename }}.exe"
mv gpujpeg-*-win64.exe "./$fname"
.github/scripts/replace-asset.sh continuous "$fname" \
application/vnd.microsoft.portable-executable\
"${{ matrix.name_prefix }} installer"
shell: C:\shells\msys2bash.cmd {0}
# vi: set expandtab sw=2: