Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI improvements #684

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/CodeQL.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '43 21 * * 5'

env:
SDK_VERSION_REPO: 1.3.275

jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
permissions:
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'c-cpp' ]

steps:
- name: Check Out Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
build-essential \
git \
cmake \
ninja-build \
pkgconf \
libgtkmm-3.0-dev \
libcairomm-1.0-dev \
libsigc++-2.0-dev \
libyaml-cpp-dev \
libglfw3-dev \
curl \
wget \
xzip \
catch2 \
mesa-vulkan-drivers

- name: Load Vulkan SDK Repo (Ubuntu 22.04)
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${{ env.SDK_VERSION_REPO }}-jammy.list https://packages.lunarg.com/vulkan/${{ env.SDK_VERSION_REPO }}/lunarg-vulkan-${{ env.SDK_VERSION_REPO }}-jammy.list
sudo apt update
sudo apt install vulkan-sdk

- name: Cache FFTS
uses: actions/cache@v4
with:
path: ~/ffts
key: ${{ runner.os }}-ubuntu-22.04-ffts

- name: Clone and Build FFTS Library
run: |
if [[ ! -d ~/ffts ]]; then
cd
git clone https://github.com/anthonix/ffts.git
cd ffts
mkdir build
cd build
cmake \
-DENABLE_SHARED=ON \
-GNinja \
..
ninja
fi
cd ~/ffts/build
sudo ninja install


# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Configure
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DDISABLE_PCH=ON \
-GNinja \
..

- name: Build
run: |
cd build
ninja



- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
44 changes: 11 additions & 33 deletions .github/workflows/build-debian-seflhosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
VULKAN_SDK_VERSION: 1.3.250.1
VULKAN_SDK_VERSION: 1.275.0

jobs:

Expand All @@ -24,21 +24,22 @@ jobs:
sudo apt-get update
sudo apt-get -y install \
build-essential \
git \
cmake \
pkg-config \
libglm-dev \
pkgconf \
libgtkmm-3.0-dev \
libcairomm-1.0-dev \
libsigc++-2.0-dev \
libyaml-cpp-dev \
catch2 \
libglfw3-dev \
curl \
xzip \
liblxi-dev \
dvipng \
texlive \
texlive-fonts-extra \
texlive-extra-utils \
dvipng \
libglew-dev \
libvulkan-dev \
glslang-dev \
libglfw3-dev
texlive-extra-utils

- name: Clone and Build FFTS Library
run: |
Expand All @@ -53,40 +54,17 @@ jobs:
sudo make install
popd

- name: Clone and Build Catch2 Library
run: |
git clone https://github.com/catchorg/Catch2 /tmp/catch2
pushd /tmp/catch2
git checkout v2.13.5
mkdir build
cd build
cmake ..
make -j
sudo make install
popd

- name: Install Vulkan SDK
run: |
pushd ~
mkdir vulkan
cd vulkan
wget https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/linux/vulkansdk-linux-x86_64-${{ env.VULKAN_SDK_VERSION }}.tar.gz
tar xf vulkansdk-linux-x86_64-${{ env.VULKAN_SDK_VERSION }}.tar.gz
export VULKAN_SDK=~/vulkan/${{ env.VULKAN_SDK_VERSION }}/x86_64
sudo cp -r $VULKAN_SDK/include/vulkan/ /usr/local/include/
sudo cp -P $VULKAN_SDK/lib/libvulkan.so* /usr/local/lib/
sudo cp $VULKAN_SDK/lib/libVkLayer_*.so /usr/local/lib/
sudo mkdir -p /usr/local/share/vulkan/explicit_layer.d
sudo cp $VULKAN_SDK/etc/vulkan/explicit_layer.d/VkLayer_*.json /usr/local/share/vulkan/explicit_layer.d
sudo ldconfig
popd

- name: Build
run: |
export VULKAN_SDK=~/vulkan/${{ env.VULKAN_SDK_VERSION }}/x86_64
export PATH=$VULKAN_SDK/bin:$PATH
export LD_LIBRARY_PATH=$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export VK_LAYER_PATH=$VULKAN_SDK/etc/vulkan/explicit_layer.d
source =~/vulkan/${{ env.VULKAN_SDK_VERSION }}/setup-env.sh
mkdir build
cd build
cmake \
Expand Down
91 changes: 54 additions & 37 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,96 @@ jobs:

steps:

- uses: actions/checkout@v3
- name: Check Out Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Use CCache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ runner.os }}
max-size: "1500M"


- name: Install Dependencies
run: |
brew install \
ninja \
libsigc++@2 \
yaml-cpp \
pkg-config \
[email protected] \
glew \
libsigc++@2 \
glfw \
catch2
cmake \
yaml-cpp \
catch2 \
libomp \
vulkan-headers \
vulkan-loader \
spirv-tools \
glslang \
shaderc \
molten-vk \
ninja

- name: Cache FFTS
uses: actions/cache@v4
with:
path: ~/ffts-prefix
key: ${{ runner.os }}-ffts-prefix


- name: Clone and Build FFTS Library
run: |
git clone https://github.com/anthonix/ffts.git /tmp/ffts
pushd /tmp/ffts
[[ -d ~/ffts-prefix ]] && exit 0
cd
git clone https://github.com/anthonix/ffts.git
cd ffts
mkdir build
cd build
cmake \
-DENABLE_SHARED=ON \
-DCMAKE_INSTALL_PREFIX=$HOME/ffts-prefix \
-DCMAKE_INSTALL_RPATH=$HOME/ffts-prefix/lib \
-DCMAKE_MACOSX_RPATH=ON \
-GNinja \
..
make -j4
sudo make install
popd

- name: Install Vulkan SDK
uses: humbletim/[email protected]
with:
version: 1.3.268.1
cache: true
ninja
sudo ninja install

- name: Build
- name: Configure
run: |
export PATH=$(brew --prefix llvm@14)/bin:$PATH
export DYLD_LIBRARY_PATH=$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH
export VK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json
export VK_LAYER_PATH=$VULKAN_SDK/etc/vulkan/explicit_layer.d
export CC=clang
export CXX=clang++
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
mkdir build
cd build
cmake \
-DDISABLE_PCH=ON \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_DOCS=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_PREFIX_PATH="$(brew --prefix);$(brew --prefix libomp)" \
-DBUILD_TESTING=ON \
-DCMAKE_PREFIX_PATH="$(brew --prefix)/opt/libomp;$HOME/ffts-prefix" \
..

- name: Build
run: |
cd build
ninja

- name: Run Tests
if: ${{ false }} # Temporary disable Run Tests
if: ${{ false }} # Metal is not available on GH macOS runners
run: |
cd build
ninja test

- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ngscopeclient-macos
name: ngscopeclient-${{ runner.os }}-${{ github.job }}
path: |
build/src/ngscopeclient/ngscopeclient
build/src/ngscopeclient/icons/*
build/src/ngscopeclient/shaders/*
build/lib/scopehal/libscopehal.dylib
build/lib/scopeprotocols/libscopeprotocols.dylib

- name: Upload Documentation
if: ${{ false }} # a LaTeX toolchain for macOS takes a while to install, so skip for now
uses: actions/upload-artifact@v3
with:
name: ngscopeclient-manual
path: build/doc/ngscopeclient-manual.pdf
build/lib/scopeprotocols/libscopeprotocols.dylib
Loading
Loading