-
Notifications
You must be signed in to change notification settings - Fork 68
149 lines (136 loc) · 5.55 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
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
steps:
- uses: actions/checkout@main
- name: Install
run: |
sudo apt update
sudo apt install cmake jq nvidia-cuda-toolkit
- name: Build
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib' \
-DCMAKE_CUDA_ARCHITECTURES=35 -Bbuild .
cmake --build build --parallel
ctest -R unittests
cmake --install build --prefix GPUJPEG
tar caf GPUJPEG-Linux.tar.xz GPUJPEG
- name: Upload Archive
if: github.repository != 'CESNET/GPUJPEG' || github.ref != 'refs/heads/master'
uses: actions/upload-artifact@main
with:
name: GPUJPEG CI Linux build
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 GPUJPEG-Linux.tar.xz application/x-gtar Linux%20build
Windows:
name: run Windows
needs: retag-continuous
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- name: install CUDA
run: |
choco install cuda -y --no-progress --version=11.8.0.52206
#$url="https://developer.download.nvidia.com/compute/cuda/12.1.0/network_installers/cuda_12.1.0_windows_network.exe"
#$url -match 'cuda/(?<version>[0-9]+.[0-9]+)'
#$version=$Matches.version
#Invoke-WebRequest $url -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: |
#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"
# 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=35 -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 Windows 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 Windows 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: |
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 GPUJPEG.zip application/zip Windows%20build
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: |
mv gpujpeg-*-win64.exe GPUJPEG.exe
.github/scripts/replace-asset.sh continuous GPUJPEG.exe application/vnd.microsoft.portable-executable Windows%20installer
shell: C:\shells\msys2bash.cmd {0}
# vi: set expandtab sw=2: