diff --git a/.github/cache/action.yml b/.github/cache/action.yml index 89f197f..e340d98 100644 --- a/.github/cache/action.yml +++ b/.github/cache/action.yml @@ -1,6 +1,9 @@ name: cache descritpion: Set up cache for vcpkg inputs: + path: + description: "The path to cache" + required: true triplet: description: "The vcpkg triplet to cache" required: true @@ -10,6 +13,6 @@ runs: - name: Cache vcpkg uses: actions/cache@v4 with: - path: vcpkg-cache + path: ${{ inputs.path }} key: vcpkg-${{ inputs.triplet }}-${{ hashFiles('vcpkg.json') }} diff --git a/.github/scripts/osx_setup.sh b/.github/scripts/osx_setup.sh new file mode 100755 index 0000000..0a3f6a8 --- /dev/null +++ b/.github/scripts/osx_setup.sh @@ -0,0 +1,2 @@ +brew install autoconf autoconf-archive automake libtool ninja +/Users/runner/work/vcpkg/bootstrap-vcpkg.sh \ No newline at end of file diff --git a/.github/free_disk_space.sh b/.github/scripts/ubuntu_setup.sh similarity index 76% rename from .github/free_disk_space.sh rename to .github/scripts/ubuntu_setup.sh index b03f22d..cfc2eca 100755 --- a/.github/free_disk_space.sh +++ b/.github/scripts/ubuntu_setup.sh @@ -41,7 +41,6 @@ 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/ @@ -49,3 +48,35 @@ rm -rf /opt/hostedtoolcache rm -rf /opt/ghc sudo rm -rf /usr/local/lib/android df -h +sudo apt-get update +sudo apt-get install -y \ + autoconf \ + autoconf-archive \ + automake \ + libtool \ + libltdl-dev \ + '^libxcb.*-dev' \ + libdbus-1-dev \ + libegl1-mesa-dev \ + libglu1-mesa-dev \ + libice-dev \ + libsctp-dev \ + libsm-dev \ + libx11-dev \ + libx11-xcb-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-keysyms1-dev \ + libxcb-render-util0-dev \ + libxcb-render0-dev \ + libxcb-shape0-dev \ + libxcb-shm0-dev \ + libxcb-sync-dev \ + libxcb-xfixes0-dev \ + libxcb-xinerama0-dev \ + libxcb-xkb-dev \ + libxi-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libxrender-dev + df -h \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7430797 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +name: Build + +on: + push: [master] + +permissions: + contents: write + packages: write + +jobs: + build: + name: Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + triplet: x64-windows + vcpkg_root: D:\a\vcpkg + - os: ubuntu-latest + triplet: x64-linux + vcpkg_root: /home/runner/vcpkg + - os: macos-latest + triplet: x64-osx + vcpkg_root: /Users/runner/work/vcpkg + env: + VCPKG_BINARY_SOURCES: >- + clear;http,http://${{secrets.TS_IPV4}}:12345,readwrite + + steps: + - name: Tailscale connect (MacOS) + if: matrix.os == 'macos-latest' + uses: tailscale/github-action@v3 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + tags: tag:ci + + - name: Tailscale connect (Linux/Windows) + if: matrix.os != 'macos-latest' + uses: tailscale/github-action@v4 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + tags: tag:ci + + - name: Checkout vcpkg + run: | + git clone --branch 2026.01.16 https://github.com/microsoft/vcpkg ${{ matrix.vcpkg_root }} + + - name: Checkout WebFrame + uses: actions/checkout@v4 + + - name: Ubuntu setup + if: matrix.os == 'ubuntu-latest' + run: ./.github/scripts/ubuntu_setup.sh + + - name: MacOS setup + if: matrix.os == 'macos-latest' + run: ./.github/scripts/osx_setup.sh + + - name: CMake build + run: | + cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=${{ matrix.vcpkg_root }}/scripts/buildsystems/vcpkg.cmake + cmake --build build \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index b3008e2..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,61 +0,0 @@ -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: | - git clone https://github.com/microsoft/vcpkg - - - name: Ubuntu Setup - if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - ${{ github.workspace }}/.github/free_disk_space.sh - 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' }} --clean-buildtrees-after-build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index cf8a4fa..7bddcbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.15) project(webframe VERSION 0.1.0) -add_library(webframe_shell STATIC src/shell/shell.cpp) +#add_library(webframe_shell STATIC src/shell/shell.cpp) -add_library(webframe_desktop SHARED) +#add_library(webframe_desktop SHARED) -add_library(webframe_browser SHARED) +#add_library(webframe_browser SHARED) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index bb7a631..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Tests for WebFrame - -message(STATUS "Test directory placeholder")