Skip to content

comment some parts #300

comment some parts

comment some parts #300

name: Flet Build Test
on:
push:
branches-ignore:
- main
paths:
- '.github/workflows/flet-build-test.yml'
- '.fvmrc'
- 'client/**'
- 'sdk/python/packages/**'
- 'packages/flet/**'
- 'sdk/python/examples/apps/flet_build_test'
pull_request:
paths:
- '.github/workflows/flet-build-test.yml'
- '.fvmrc'
- 'client/**'
- 'sdk/python/packages/**'
- 'packages/flet/**'
- 'sdk/python/examples/apps/flet_build_test'
workflow_dispatch:
inputs:
extra_args:
description: "Extra CLI args appended to `flet build ...` command (ex: --template-ref 0.1.0)"
required: false
default: ""
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true
env:
UV_PYTHON: 3.12
PYTHONUTF8: 1
# https://docs.flet.dev/reference/environment-variables
FLET_CLI_NO_RICH_OUTPUT: 1
# Extra args passed via workflow_dispatch (empty for push/PR)
FLET_BUILD_EXTRA_ARGS: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_args || '' }}
jobs:
build:
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# -------- Desktop --------
# - name: linux
# runner: ubuntu-latest
# build_cmd: "flet build linux"
# artifact_name: linux-build-artifact
# artifact_path: build/linux
# needs_linux_deps: true
#
# - name: macos
# runner: macos-latest
# build_cmd: "flet build macos"
# artifact_name: macos-build-artifact
# artifact_path: build/macos
# needs_linux_deps: false
#
# - name: windows
# runner: windows-latest
# build_cmd: "flet build windows"
# artifact_name: windows-build-artifact
# artifact_path: build/windows
# needs_linux_deps: false
# -------- Android --------
# - name: aab-ubuntu
# runner: ubuntu-latest
# build_cmd: "flet build aab"
# artifact_name: aab-build-ubuntu-artifact
# artifact_path: build/aab
# needs_linux_deps: false
#
# - name: aab-macos
# runner: macos-latest
# build_cmd: "flet build aab"
# artifact_name: aab-build-macos-artifact
# artifact_path: build/aab
# needs_linux_deps: false
#
# - name: aab-windows
# runner: windows-latest
# build_cmd: "flet build aab"
# artifact_name: aab-build-windows-artifact
# artifact_path: build/aab
# needs_linux_deps: false
#
# - name: apk-ubuntu
# runner: ubuntu-latest
# build_cmd: "flet build apk"
# artifact_name: apk-build-ubuntu-artifact
# artifact_path: build/apk
# needs_linux_deps: false
#
# - name: apk-macos
# runner: macos-latest
# build_cmd: "flet build apk"
# artifact_name: apk-build-macos-artifact
# artifact_path: build/apk
# needs_linux_deps: false
#
# - name: apk-windows
# runner: windows-latest
# build_cmd: "flet build apk"
# artifact_name: apk-build-windows-artifact
# artifact_path: build/apk
# needs_linux_deps: false
# -------- iOS --------
# - name: ipa
# runner: macos-latest
# build_cmd: "flet build ipa"
# artifact_name: ipa-build-artifact
# artifact_path: build/ipa
# needs_linux_deps: false
#
# - name: ios-simulator
# runner: macos-latest
# build_cmd: "flet build ios-simulator"
# artifact_name: ios-simulator-build-artifact
# artifact_path: build/ios-simulator
# needs_linux_deps: false
# -------- Web --------
- name: web-ubuntu
runner: ubuntu-latest
build_cmd: "flet build web"
artifact_name: web-build-ubuntu-artifact
artifact_path: build/web
needs_linux_deps: false
- name: web-macos
runner: macos-latest
build_cmd: "flet build web"
artifact_name: web-build-macos-artifact
artifact_path: build/web
needs_linux_deps: false
- name: web-windows
runner: windows-latest
build_cmd: "flet build web"
artifact_name: web-build-windows-artifact
artifact_path: build/web
needs_linux_deps: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup uv
uses: astral-sh/setup-uv@v6
- name: Install Linux dependencies
if: matrix.needs_linux_deps
shell: bash
run: |
sudo apt update --allow-releaseinfo-change
sudo apt-get install -y --no-install-recommends \
clang \
ninja-build \
libgtk-3-dev \
libasound2-dev \
libmpv-dev \
mpv \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
gstreamer1.0-tools \
gstreamer1.0-x \
gstreamer1.0-alsa \
gstreamer1.0-gl \
gstreamer1.0-gtk3 \
gstreamer1.0-qt5 \
gstreamer1.0-pulseaudio \
pkg-config \
libsecret-1-0 \
libsecret-1-dev
sudo apt-get clean
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
cache: true
- name: Build app
shell: bash
working-directory: sdk/python/examples/apps/flet_build_test
run: |
echo "FLET_BUILD_EXTRA_ARGS='${FLET_BUILD_EXTRA_ARGS}'"
uv run ${{ matrix.build_cmd }} --yes --verbose --build-number ${{ github.run_number }} $FLET_BUILD_EXTRA_ARGS
- name: Smoke test flet serve for web builds
if: startsWith(matrix.name, 'web-')
shell: bash
run: |
uv run --directory sdk/python/examples/apps/flet_build_test \
python "${{ github.workspace }}/.github/scripts/smoke_test_flet_serve.py" \
--web-root "${{ github.workspace }}/sdk/python/examples/apps/flet_build_test/build/web" \
--log-file "${{ github.workspace }}/sdk/python/examples/apps/flet_build_test/flet-serve-smoke.log"
- name: Upload Artifact
uses: actions/upload-artifact@v5.0.0
with:
name: ${{ matrix.artifact_name }}
path: sdk/python/examples/apps/flet_build_test/${{ matrix.artifact_path }}
if-no-files-found: error
overwrite: false