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

Use vcpkg for providing dependencies. #37

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
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
53 changes: 41 additions & 12 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on: [push, pull_request, workflow_dispatch]

env:
BUILD_TYPE: Release # Change build type here.
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'

jobs:
build:
Expand All @@ -15,33 +17,60 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.2.4 # Update Qt version here.
aqtversion: '>=0.9.7'
modules: 'qtimageformats'
submodules: recursive

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
# Since VCPKG take a lot of space for Qt install, we run out of free disk space on Ubuntu 20.04
# This will remove some unused runner image dependencies
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
boost_version: 1.72.0 # Update Boost version here.
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Prepare dependencies
shell: bash
run: |
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev

- name: Build
shell: bash
run: |
cd build
cmake ..
cmake --build . --config $BUILD_TYPE --target Degate
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Tests
shell: bash
run: |
cd build
cmake .. -DBUILD_TESTS=1
cmake --build . --config $BUILD_TYPE --target DegateTests
cd tests/out/bin
./DegateTests

- name: Upload vcpkg build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: 'vcpkg-buildlogs-${{ matrix.triplet }}'
path: ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
34 changes: 24 additions & 10 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on: [push, pull_request, workflow_dispatch]

env:
BUILD_TYPE: Release # Change build type here.
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'

jobs:
build:
Expand All @@ -15,19 +17,22 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.2.4 # Update Qt version here.
aqtversion: '>=0.9.7'
modules: 'qtimageformats'
submodules: recursive

- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
boost_version: 1.72.0 # Update Boost version here.
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Prepare dependencies
shell: bash
run: |
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
brew reinstall autoconf
brew install automake autoconf-archive

- name: Build
shell: bash
Expand All @@ -42,6 +47,15 @@ jobs:
shell: bash
run: |
cd build
cmake .. -DBUILD_TESTS=1
cmake --build . --config $BUILD_TYPE --target DegateTests
cd tests/out/bin
./DegateTests

- name: Upload vcpkg build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: 'vcpkg-buildlogs-${{ matrix.triplet }}'
path: ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log

37 changes: 26 additions & 11 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ on: [push, pull_request, workflow_dispatch]

env:
BUILD_TYPE: Release # Change build type here.
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'

jobs:
build:
runs-on: windows-latest # Change Windows version here.

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Install Qt
uses: jurplel/install-qt-action@v3
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
version: 6.2.4 # Update Qt version here.
aqtversion: '>=0.9.7'
modules: 'qtimageformats'
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.72.0 # Update Boost version here.
- name: Prepare dependencies
shell: cmd
run: |
.\vcpkg\bootstrap-vcpkg.bat -disableMetrics

- name: Build
shell: bash
Expand All @@ -38,7 +41,19 @@ jobs:
shell: bash
run: |
cd build
cmake .. -DBUILD_TESTS=1
cmake --build . --config $BUILD_TYPE --target DegateTests
# Windeployqt is sooo broken when using vcpkg...
# ./vcpkg_installed/x64-windows/tools/Qt6/bin/windeployqt.exe ./tests/out/bin/$BUILD_TYPE
mkdir -P tests/out/bin/$BUILD_TYPE/imageformats
find . -name vcpkg_installed/x64-windows-degate/Qt6/plugins/imageformats/*.dll -exec cp {} tests/out/bin/$BUILD_TYPE/imageformats/ \;
cd tests/out/bin/$BUILD_TYPE
$Qt6_DIR/bin/windeployqt.exe ./
./DegateTests.exe

- name: Upload vcpkg build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: 'vcpkg-buildlogs-${{ matrix.triplet }}'
path: ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log

65 changes: 35 additions & 30 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "CodeQL"

env:
BUILD_TYPE: Release # Change build type here.
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'

on:
push:
Expand All @@ -25,44 +27,47 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

# Since VCPKG take a lot of space for Qt install, we run out of free disk space on Ubuntu 20.04
# This will remove some unused runner image dependencies
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 6.2.4 # Update Qt version here.
aqtversion: '>=0.9.7'

- name: Install Boost
- name: Prepare dependencies
shell: bash
run: |
sudo apt-get install -y libboost-all-dev

./vcpkg/bootstrap-vcpkg.sh -disableMetrics
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev

- name: Build
shell: bash
run: |
Expand All @@ -71,4 +76,4 @@ jobs:
cmake --build . --config $BUILD_TYPE

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ doc/config/DoxyFile

build.sh
run.sh
release.sh
test.sh
doc.sh
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg/
Loading
Loading