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

Merged
merged 26 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
97b3973
Use vcpkg for providing dependencies.
agatti Mar 22, 2024
28e3bfb
Merge branch 'master' into vcpkg
DorianBDev Sep 17, 2024
8fbc6a4
Updated the CMakeLists.txt file to use vcpkg.
DorianBDev Sep 18, 2024
f62c542
Updated vcpkg version.
DorianBDev Sep 18, 2024
0df029d
Added qtbase's dependencies to the linux CI .
DorianBDev Sep 18, 2024
bbb88fe
Fixed missing sudo in linux CI.
DorianBDev Sep 18, 2024
c3bbeba
Added new system dependencies for Linux CI regarding vcpkg.
DorianBDev Sep 18, 2024
1a144f4
Added vcpkg logs artifact upload for ci.
DorianBDev Sep 20, 2024
03c6a31
Fixed missing VCPKG_ROOT variable in CI.
DorianBDev Sep 20, 2024
088c62b
Added new step to CI to free disk before vcpkg installs.
DorianBDev Sep 20, 2024
0eee8bc
Added missing boost libraries for vcpkg.
DorianBDev Sep 20, 2024
5c4daea
Added missing boost header for file system code.
DorianBDev Sep 20, 2024
7c2a3a4
Improved vcpkg.json file and fixed an include bug.
DorianBDev Sep 23, 2024
576d50f
Updated mac and windows CI to use vcpkg.
DorianBDev Sep 23, 2024
de57e61
Fixed windows and mac CIs.
DorianBDev Sep 23, 2024
65a3ae1
Fixed mac autoconf install and windows qt6 path.
DorianBDev Sep 23, 2024
4c4ff8a
Try fixing missing dlls for Windows.
DorianBDev Sep 24, 2024
a049662
Integrated Qt deployapi into CMakeLists script.
DorianBDev Sep 24, 2024
365b285
Added warning when no OpenGL driver detecter.
DorianBDev Sep 27, 2024
768be0a
Use system Qt library by default.
DorianBDev Nov 24, 2024
28d7ff2
Fixed missing cmake qt functions.
DorianBDev Nov 25, 2024
4cc33c7
Fixed missing Qt install for CIs.
DorianBDev Nov 25, 2024
6196ff0
Try fixing windows CI, missing windeployqt.
DorianBDev Nov 25, 2024
b707923
Fixed deploy CIs.
DorianBDev Nov 25, 2024
7163404
Updated the README regarding vcpkg integration.
DorianBDev Nov 25, 2024
283fea7
Improved the README for linux quick start.
DorianBDev Nov 25, 2024
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
54 changes: 45 additions & 9 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,67 @@ jobs:

steps:
- 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

- 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: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: 6.2.4 # Update Qt version here.
aqtversion: '>=0.9.7'
modules: 'qtimageformats'

- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.72.0 # Update Boost version here.

- 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
39 changes: 29 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,33 +17,50 @@ jobs:

steps:
- 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 || '');

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

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

- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.72.0 # Update Boost version here.

- 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

39 changes: 30 additions & 9 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,62 @@ 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: 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 Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: 6.2.4 # Update Qt version here.
aqtversion: '>=0.9.7'
modules: 'qtimageformats'

- 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
run: |
cd build
cmake .. -A x64
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
# 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 ./
$QT_ROOT_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

68 changes: 40 additions & 28 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,54 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2

# 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
submodules: recursive

# 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
- 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 || '');

# ✏️ 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
# 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

#- run: |
# make bootstrap
# make release

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

- name: Install Boost
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- 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 +83,4 @@ jobs:
cmake --build . --config $BUILD_TYPE

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
Loading
Loading