From c9d933322038c500b9e2c3957a08761418c15500 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sat, 9 Nov 2024 14:51:31 +0000 Subject: [PATCH] wip --- .github/workflows/build.yml | 49 ++++++++----------------------------- docker/Dockerfile | 30 +++++++++++++++++++++++ 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b4091b..7ba56b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: fail-fast: true matrix: os: - - ubuntu-latest + - self-hosted # - windows-latest # - macos-latest @@ -23,12 +23,6 @@ jobs: with: fetch-depth: 0 - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: 6.7.3 - cache: true - - name: Install ninja-build tool (must be after Qt due PATH changes) if: ${{ runner.os == 'Windows' }} uses: turtlesec-no/get-ninja@main @@ -37,17 +31,6 @@ jobs: if: ${{ runner.os == 'Windows' }} uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies on Ubuntu - if: ${{ runner.os == 'Linux' }} - run: | - sudo apt update -qq - sudo apt install libgtk-3-dev libglib2.0-dev ninja-build lld xvfb -y - - - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.24.0' - channel: 'stable' - - name: Checkout qt-embedder uses: actions/checkout@v4 @@ -55,28 +38,16 @@ jobs: run: | mkdir -p 3rdparty/out/host_debug_unopt/ - - name: Checkout flutter engine - uses: actions/checkout@v4 - with: - repository: iamsergio/engine.git - ref: wip/multiwindow - path: 3rdparty/flutter/ - - name: debug run: | flutter --version + dart --version which flutter which dart - - - name: Fix embedder header - run: cp 3rdparty/flutter/shell/platform/embedder/embedder.h 3rdparty/flutter/shell/platform/embedder/flutter_embedder.h - - - name: Download engine binary - run: | - ./download_engine.sh - cp libflutter_engine.so 3rdparty/out/host_debug_unopt/ + ls $FLUTTER_ENGINE_FOLDER + echo "WORKSPACE: ${{ github.workspace }}" env: - GH_TOKEN: ${{ github.token }} + FLUTTER_ENGINE_FOLDER: ${{ github.workspace }}/3rdparty/flutter/ - name: Configure project run: cmake -S . -B ./build-dev --preset dev @@ -88,8 +59,8 @@ jobs: env: FLUTTER_ENGINE_FOLDER: ${{ github.workspace }}/3rdparty/flutter/ - # - name: Build example - # run: | - # ./build_example.sh - # env: - # FLUTTER_ENGINE_FOLDER: ${{ github.workspace }}/3rdparty/flutter/ + - name: Build example + run: | + ./build_example.sh + env: + FLUTTER_ENGINE_FOLDER: ${{ github.workspace }}/3rdparty/flutter/ diff --git a/docker/Dockerfile b/docker/Dockerfile index 6e70ebf..407e2e9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,9 +8,14 @@ # Docker container for building the engine and testing qt-flutter-embedder # in CI +# docker build --build-arg GITHUB_RUNNER_TOKEN=$GITHUB_RUNNER_TOKEN -t qt-flutter-embedder . +# docker run -it qt-flutter-embedder /home/ubuntu/actions-runner/run.sh + FROM ubuntu:24.10 MAINTAINER Sergio Martins (sergio.martins@kdab.com) +ARG GITHUB_RUNNER_TOKEN + ENV TZ=Europe/Berlin ENV LC_CTYPE=C.UTF-8 # ENV LD_LIBRARY_PATH=/Qt5/lib/:/Qt6/lib/ @@ -45,3 +50,28 @@ git fetch sergio && \ git checkout sergio/main && gclient sync -D RUN cd $FLUTTER_ENGINE_FOLDER && ./build.sh && cp ./shell/platform/embedder/embedder.h ./shell/platform/embedder/flutter_embedder.h + +# Install GitHub Actions runner + +RUN mkdir actions-runner && cd actions-runner && \ + curl -o actions-runner-linux-x64-2.320.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.320.0/actions-runner-linux-x64-2.320.0.tar.gz && \ + echo "93ac1b7ce743ee85b5d386f5c1787385ef07b3d7c728ff66ce0d3813d5f46900 actions-runner-linux-x64-2.320.0.tar.gz" | shasum -a 256 -c && \ + tar xzf ./actions-runner-linux-x64-2.320.0.tar.gz && \ + ./config.sh --url https://github.com/KDABLabs/qt-flutter-embedder --token $GITHUB_RUNNER_TOKEN + +# More dependencies, TODO: move up! +USER root +RUN apt install xvfb -y + +# Install GitHub command-line interface (gh) +# Instructions copied from https://github.com/cli/cli/blob/trunk/docs/install_linux.md +RUN mkdir -p -m 755 /etc/apt/keyrings \ + && curl -s https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && apt-get update \ + && apt-get install gh -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +USER ubuntu