ci(codeql): fix codeql builds (#2475)

This commit is contained in:
ReenigneArcher 2024-05-14 19:20:37 -04:00 committed by GitHub
parent ff54ab2852
commit d70a17a2fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 16 deletions

View File

@ -1,7 +1,23 @@
# install dependencies for C++ analysis
set -e
CUDA_VERSION=11.8.0
CUDA_BUILD=520.61.05
# install wget and cuda first
sudo apt-get update -y
sudo apt-get install -y \
wget
# Install CUDA
url_base="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers"
url="${url_base}/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux.run"
sudo wget -q -O /root/cuda.run ${url}
sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr/local/cuda --no-opengl-libs --no-man-page --no-drm
sudo rm /root/cuda.run
# Install dependencies
sudo apt-get install -y \
build-essential \
gcc-10 \
@ -32,8 +48,7 @@ sudo apt-get install -y \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
wget
libxtst-dev
# clean apt cache
sudo apt-get clean
@ -48,19 +63,17 @@ sudo update-alternatives --install \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10
# Install CUDA
sudo wget \
https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \
--progress=bar:force:noscroll -q --show-progress -O /root/cuda.run
sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm
sudo rm /root/cuda.run
# build
mkdir -p build
cd build || exit 1
cmake -G "Unix Makefiles" ..
cmake \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
-G "Unix Makefiles" \
..
make -j"$(nproc)"
# Delete CUDA
sudo rm -rf /usr/local/cuda
# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"

View File

@ -476,7 +476,7 @@ jobs:
# permissions
chmod +x ../artifacts/sunshine.AppImage
- name: Delete cuda
- name: Delete CUDA
# free up space on the runner
run: |
sudo rm -rf /usr/local/cuda

View File

@ -63,7 +63,9 @@ jobs:
if (key.toLowerCase() === 'swift') {
osList = ['macos-latest'];
} else if (key.toLowerCase() === 'cpp') {
osList = ['macos-latest', 'ubuntu-latest', 'windows-latest'];
// TODO: update macos to latest after the below issue is resolved
// https://github.com/github/codeql-action/issues/2266
osList = ['macos-13', 'ubuntu-latest', 'windows-latest'];
}
for (let os of osList) {
// set name for matrix
@ -120,10 +122,12 @@ jobs:
steps:
- name: Maximize build space
if: runner.os == 'Linux'
uses: easimon/maximize-build-space@v8
if: >-
runner.os == 'Linux' &&
matrix.language == 'cpp'
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 20480
root-reserve-mb: 30720
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
remove-android: 'true'
remove-haskell: 'true'