diff --git a/.github/cache/action.yml b/.github/cache/action.yml new file mode 100644 index 0000000..89f197f --- /dev/null +++ b/.github/cache/action.yml @@ -0,0 +1,15 @@ +name: cache +descritpion: Set up cache for vcpkg +inputs: + triplet: + description: "The vcpkg triplet to cache" + required: true +runs: + using: "composite" + steps: + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: vcpkg-cache + key: vcpkg-${{ inputs.triplet }}-${{ hashFiles('vcpkg.json') }} + diff --git a/.github/free_disk_space.sh b/.github/free_disk_space.sh new file mode 100755 index 0000000..e9b64d4 --- /dev/null +++ b/.github/free_disk_space.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# +# The Azure provided machines typically have the following disk allocation: +# Total space: 85GB +# Allocated: 67 GB +# Free: 17 GB +# This script frees up 28 GB of disk space by deleting unneeded packages and +# large directories. +# The Flink end to end tests download and generate more than 17 GB of files, +# causing unpredictable behavior and build failures. +# +echo "==============================================================================" +echo "Freeing up disk space on CI system" +echo "==============================================================================" + +echo "Listing 100 largest packages" +dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100 +df -h +echo "Removing large packages" +sudo apt-get remove -y '^ghc-8.*' +sudo apt-get remove -y '^dotnet-.*' +sudo apt-get remove -y '^llvm-.*' +sudo apt-get remove -y 'php.*' +sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel +sudo apt-get autoremove -y +sudo apt-get clean +df -h +echo "Removing large directories" +# deleting 15GB +rm -rf /usr/share/dotnet/ +df -h \ No newline at end of file diff --git a/.github/vcpkg/action.yml b/.github/vcpkg/action.yml new file mode 100644 index 0000000..648ac02 --- /dev/null +++ b/.github/vcpkg/action.yml @@ -0,0 +1,25 @@ +name: vcpkg +descritpion: Bootstrap and install dependencies with vcpkg +inputs: + os: + description: "The operating system to run the job on" + required: true + triplet: + description: "The vcpkg triplet to use" + required: true + shell: + description: "The shell to use for running commands (optional)" + required: true +runs: + using: "composite" + steps: + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Clone vcpkg + shell: ${{ inputs.shell }} + run: git clone https://github.com/microsoft/vcpkg + - name: Bootstrap vcpkg + shell: ${{ inputs.shell }} + run: python ./.github/vcpkg/setup.py --os ${{ inputs.os }} --triplet ${{ inputs.triplet }} + diff --git a/.github/vcpkg/setup.py b/.github/vcpkg/setup.py new file mode 100644 index 0000000..2fbb68d --- /dev/null +++ b/.github/vcpkg/setup.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import argparse +import subprocess +import sys + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Setup vcpkg for the project") + parser.add_argument("--vcpkg-root", type=str, default="vcpkg", help="Path to the vcpkg directory") + args = parser.parse_args() + + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..25ac1a8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,61 @@ +name: Test + +on: + push: + +jobs: + build: + name: Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + triplet: x64-windows + shell: powershell + - os: ubuntu-latest + triplet: x64-linux + shell: bash + env: + VCPKG_BINARY_SOURCES: >- + clear;files,${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }},readwrite + + steps: + - uses: actions/checkout@v4 + + - name: Restore vcpkg cache + uses: ./.github/cache + with: + triplet: ${{ matrix.triplet }} + + - name: Windows vcpkg clone + if: ${{ matrix.os == 'windows-latest' }} + run: git clone https://github.com/microsoft/vcpkg D:\a\vcpkg + + - name: Set VCPKG_ROOT on Windows + if: ${{ matrix.os == 'windows-latest' }} + run: echo "VCPKG_ROOT=D:\a\vcpkg" >> $GITHUB_ENV + shell: powershell + + - name: Posix vcpkg clone + if: ${{ matrix.os != 'windows-latest' }} + run: | + ${{ github.workspace }}/.github/free_disk_space.sh + git clone https://github.com/microsoft/vcpkg + + - name: Ubuntu Setup + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + sudo apt-get update + sudo apt-get install -y autoconf autoconf-archive automake libtool libltdl-dev + 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 libsctp-dev libx11-dev libx11-xcb-dev libsm-dev libice-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-render-util0-dev + sudo apt-get install -y libxcb-render0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev + sudo apt-get install -y libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev libdbus-1-dev + + - name: Bootstrap vcpkg + run: ${{matrix.os == 'windows-latest' && 'D:\a\vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh'}} + + - name: Install dependencies + run: ${{matrix.os == 'windows-latest' && 'D:\a\vcpkg\vcpkg install' || './vcpkg/vcpkg install'}} --triplet ${{matrix.triplet}} --x-install-root ${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f520577..cf8a4fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,9 @@ cmake_minimum_required(VERSION 3.15) - project(webframe VERSION 0.1.0) + +add_library(webframe_shell STATIC src/shell/shell.cpp) + +add_library(webframe_desktop SHARED) + +add_library(webframe_browser SHARED) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bbbb971..bb7a631 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,3 @@ # Tests for WebFrame -# Placeholder for tests -# You can add test executables here using add_executable() and add_test() - -message(STATUS "Test directory - add tests here") +message(STATUS "Test directory placeholder")