Skip to content

Commit

Permalink
ci(codeql): fix codeql builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Apr 27, 2024
1 parent 7fb8c76 commit 90175fe
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
35 changes: 24 additions & 11 deletions .codeql-prebuild-cpp-Linux.sh
@@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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 \
-G "Unix Makefiles" \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
..
make -j"$(nproc)"

# Delete CUDA
sudo rm -rf /usr/local/cuda

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
17 changes: 17 additions & 0 deletions .codeql-prebuild-cpp-macOS.sh
@@ -1,7 +1,24 @@
# install dependencies for C++ analysis
set -e

# The following error occurs without arch -arm64 on macOS-14 runner:
# Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
# To rerun under ARM use:
# arch -arm64 brew install ...

# detect if this is arm64
#echo "uname -m: $(uname -m)"
#echo "arch: $(arch)"
#echo "uname -p: $(uname -p)"
#echo "uname -a: $(uname -a)"
#if [[ "$(uname -m)" == "arm64" ]]; then
# brew_cmd="arch -arm64 brew"
#else
# brew_cmd="brew"
#fi

# install dependencies
brew reinstall openssl@3
brew install \
boost \
cmake \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Expand Up @@ -456,7 +456,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
Expand Down

0 comments on commit 90175fe

Please sign in to comment.