Skip to content

CI Windows: further generalization #160

CI Windows: further generalization

CI Windows: further generalization #160

Workflow file for this run

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:
conf: [legacy]
include:
- conf: legacy
build_filename: GPUJPEG-Windows
cuda_arch: 30
cuda_installer: cuda_10.2.89_win10_network.exe
name_prefix: Windows
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)
$url="https://developer.download.nvidia.com/compute/cuda/$version/Prod/network_installers/$installer"
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 -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 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: |
mv GPUJPEG.zip "./${{ matrix.build_filename }}.zip"
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 "${{ 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: