Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsergio committed Nov 9, 2024
1 parent f848f3f commit c9d9333
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
49 changes: 10 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os:
- ubuntu-latest
- self-hosted
# - windows-latest
# - macos-latest

Expand All @@ -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
Expand All @@ -37,46 +31,23 @@ 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

- name: Create folder structure
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
Expand All @@ -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/
30 changes: 30 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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

0 comments on commit c9d9333

Please sign in to comment.