CI Windows: use action to install CUDA #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-latest | |
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' -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 | |
- uses: Jimver/[email protected] | |
id: cuda-toolkit | |
- 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 | |
# 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 -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: |