temporarily disable armv7, pi3, pi4 tests #248
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build engine for Raspberry Pi 3 & 4 and generic ARMv7 & AArch64. | |
on: | |
push: | |
tags: | |
- 'engine/*' | |
pull_request: | |
branches: [ ci ] | |
repository_dispatch: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
resolve-version: | |
name: 'Resolve relevant flutter versions' | |
runs-on: ubuntu-latest | |
outputs: | |
engine-hash: ${{ steps.engine-commit.outputs.hash }} | |
first-semver: ${{ steps.flutter-sdk-version.outputs.first-semver }} | |
sdk-semvers: ${{ steps.flutter-sdk-version.outputs.semvers }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
echo github.ref: ${{ github.ref }} | |
- name: Read stable engine version | |
id: engine-commit | |
# Read the engine.version.stable file and trim away anything that's not a hex digit | |
# (So we don't include whitespace in the output variable, if that's possible) | |
run: echo "hash=$(cat engine.version.stable | tr -dc [:xdigit:])" >> $GITHUB_OUTPUT | |
- name: Log stable engine version | |
run: | | |
echo stable engine version: "${{ steps.engine-commit.outputs.hash }}" | |
- name: Cache flutter engine | |
id: cache-engine | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-flutter-engine | |
path: flutter_engine | |
# We need to checkout the complete flutter SDK to find the semver. | |
- name: Checkout flutter engine | |
uses: actions/checkout@v3 | |
with: | |
repository: flutter/engine | |
ref: ${{ steps.engine-commit.outputs.hash }} | |
path: flutter_engine | |
fetch-depth: 0 # fetch complete history | |
- name: Log git status | |
working-directory: flutter_engine | |
run: | | |
git status | |
git tag -l --points-at ${{ steps.engine-commit.outputs.hash }} | |
# reference: https://github.com/flutter/flutter/blob/a880c4ed3590477380c975f867406ba336834848/packages/flutter_tools/lib/src/version.dart#L703 | |
# if the flutter people ever decide to point more than one tags at the stable SDK commit we're in trouble here | |
- name: Find out flutter SDK semvers for this engine version | |
id: flutter-sdk-version | |
working-directory: flutter_engine | |
run: | | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "semvers<<$EOF" >> "$GITHUB_OUTPUT" | |
(( echo "[" && git tag -l --points-at ${{ steps.engine-commit.outputs.hash }} --format='"%(refname:strip=2)",' && echo "null]" ) | tr -d [:space:] ) | jq -cM .[:-1] >> "$GITHUB_OUTPUT" | |
echo "$EOF" >> "$GITHUB_OUTPUT" | |
echo "first-semver=$(git tag -l --points-at ${{ steps.engine-commit.outputs.hash }} | head -n1)" >> "$GITHUB_OUTPUT" | |
- name: Log flutter SDK semvers | |
run: | | |
echo unparsed flutter sdk semvers for engine "${{ steps.engine-commit.outputs.hash }}": | |
echo "${{ steps.flutter-sdk-version.outputs.semvers }}" | |
- name: Parse flutter SDK semvers | |
run: | | |
echo parsed semvers: | |
echo ${{ fromJson(steps.flutter-sdk-version.outputs.semvers) }} | |
populate-engine-src-cache: | |
name: 'Prepopulate engine source cache' | |
runs-on: ${{ matrix.os }} | |
needs: resolve-version | |
# run on macos and linux. | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache/restore@v3 | |
id: cache-lookup | |
with: | |
path: engine | |
key: engine-${{ needs.resolve-version.outputs.engine-hash }}-${{ runner.os }} | |
lookup-only: true | |
# Fixes gclient sync error: | |
# ... | |
# Traceback (most recent call last): | |
# File "/Users/runner/work/flutter-ci/flutter-ci/engine/src/third_party/dart/tools/generate_sdk_version_file.py", line 7, in <module> | |
# import utils | |
# File "/Users/runner/work/flutter-ci/flutter-ci/engine/src/third_party/dart/tools/utils.py", line 14, in <module> | |
# import imp | |
# ModuleNotFoundError: No module named 'imp' | |
# Error: Command 'python3 src/third_party/dart/tools/generate_sdk_version_file.py' returned non-zero exit status 1 in /Users/runner/work/flutter-ci/flutter-ci/engine | |
- name: Install depot tools requirements | |
run: | | |
${{ (runner.os == 'MacOS' && 'pip3 install zombie-imp') || (runner.os == 'Linux' && 'true') || 'false' }} | |
- name: Install depot tools | |
id: cache-depot-tools | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ github.workspace }}/depot_tools | |
key: ${{ runner.os }}-depot-tools | |
- name: Clone depot_tools (if not cached) | |
if: steps.cache-lookup.outputs.cache-hit != 'true' && steps.cache-depot-tools.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth 1 \ | |
https://chromium.googlesource.com/chromium/tools/depot_tools.git \ | |
${{ github.workspace }}/depot_tools | |
- name: Setup depot_tools | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
run: | | |
echo GCLIENT_PY3=1 >> $GITHUB_ENV | |
echo $GITHUB_WORKSPACE/depot_tools >> $GITHUB_PATH | |
# echo DEPOT_TOOLS_UPDATE=0 >> $GITHUB_ENV | |
- name: Print depot_tools debug info | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
run: | | |
echo path: | |
echo $PATH | |
echo | |
echo which python3: | |
which python3 | |
echo | |
echo python3 version: | |
python3 --version | |
- name: Check if engine has dead libcxx repo | |
id: check-dead-libcxx-repo | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
run: | | |
echo "::group::Downloading DEPS file" | |
wget https://raw.githubusercontent.com/flutter/engine/${{ needs.resolve-version.outputs.engine-hash }}/DEPS | |
echo "::endgroup::" | |
echo "::group::DEPS file contents" | |
cat ./DEPS | |
echo "::endgroup::" | |
echo '::echo::on' | |
if grep -F "7524ef50093a376f334a62a7e5cebf5d238d4c99" ./DEPS | |
then | |
echo 'dead-libcxx-repo=true' >> $GITHUB_OUTPUT | |
else | |
echo 'dead-libcxx-repo=false' >> $GITHUB_OUTPUT | |
fi | |
echo '::echo::off' | |
rm ./DEPS | |
- name: Bootstrap engine environment | |
if: steps.cache-lookup.outputs.cache-hit != 'true' && steps.check-dead-libcxx-repo.outputs.dead-libcxx-repo == 'false' | |
run: | | |
mkdir -p engine | |
cp dot-gclient.py engine/.gclient | |
- name: Bootstrap engine environment (with dead libcxx repo workaround) | |
if: steps.cache-lookup.outputs.cache-hit != 'true' && steps.check-dead-libcxx-repo.outputs.dead-libcxx-repo == 'true' | |
run: | | |
mkdir -p engine | |
cp dot-gclient-fixed.py engine/.gclient | |
- name: Install engine sources | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
working-directory: engine | |
run: | | |
gclient sync --revision src/flutter@${{ needs.resolve-version.outputs.engine-hash }} -R -D | |
- name: Prune git history | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
working-directory: engine/src | |
run: | | |
for FILE in $(find . -type d -name .git) | |
do | |
pushd "$FILE/.." | |
git rev-parse HEAD > .git/shallow | |
git tag -d $(git tag -l) || true | |
for ref in $(git for-each-ref --format="%(refname)") | |
do | |
git update-ref -d "$ref" | |
done | |
git remote remove origin | |
git reflog expire --expire=all --all | |
git gc --prune=all | |
popd | |
done | |
- uses: actions/cache/save@v3 | |
if: steps.cache-lookup.outputs.cache-hit != 'true' | |
with: | |
path: engine | |
key: engine-${{ needs.resolve-version.outputs.engine-hash }}-${{ runner.os }} | |
build: | |
name: "build ${{ matrix.build-universal && 'universal artifacts' || '' }}${{ matrix.build-engine && format('engine for {0} {1}', matrix.artifact-name, matrix.flavor) || '' }}${{ matrix.build-engine && matrix.build-gen-snapshot && ', ' || ''}}${{ matrix.build-gen-snapshot && format('{0} gen_snapshot for {1} {2}', matrix.os-nice, matrix.artifact-name, matrix.flavor) || ''}}" | |
runs-on: ${{ matrix.os }} | |
needs: [ resolve-version, populate-engine-src-cache ] | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
artifact-name: | |
- pi3 | |
- pi3-64 | |
- pi4 | |
- pi4-64 | |
- armv7-generic | |
- aarch64-generic | |
- x64-generic | |
flavor: | |
- debug_unopt | |
- debug | |
- profile | |
- release | |
exclude: | |
# for pi3, pi3-64, pi4, pi4-64 we only build the profile and release flavors. | |
# you the point of the pi3, pi4 specific artifacts is CPU-specific optimizations & tuning. | |
# (-mcpu, -mtune) | |
# You don't need CPU-specific optimizations for (unoptimized) debug builds. | |
# Instead, reuse the armv7-generic and aarch64-generic binaries there. | |
- artifact-name: pi3 | |
flavor: debug_unopt | |
- artifact-name: pi3 | |
flavor: debug | |
- artifact-name: pi3-64 | |
flavor: debug_unopt | |
- artifact-name: pi3-64 | |
flavor: debug | |
- artifact-name: pi4 | |
flavor: debug_unopt | |
- artifact-name: pi4 | |
flavor: debug | |
- artifact-name: pi4-64 | |
flavor: debug_unopt | |
- artifact-name: pi4-64 | |
flavor: debug | |
# We exclude MacOS builds that don't use profile or release mode | |
# because we're only building the gen_snapshot there anyway. | |
- os: macos-latest | |
flavor: debug_unopt | |
- os: macos-latest | |
flavor: debug | |
# MacOS gen_snapshot is only built for the generic targets. | |
- os: macos-latest | |
artifact-name: pi3 | |
- os: macos-latest | |
artifact-name: pi3-64 | |
- os: macos-latest | |
artifact-name: pi4 | |
- os: macos-latest | |
artifact-name: pi4-64 | |
include: | |
# We don't build the linux engine on MacOS because it's already | |
# built by the ubuntu runners. | |
- os: macos-latest | |
os-nice: 'MacOS' | |
build-engine: false | |
nostripped: true | |
split-debug-symbols: false | |
- os: ubuntu-latest | |
os-nice: 'Linux' | |
build-engine: true | |
nostripped: true | |
split-debug-symbols: true | |
# debug_unopt is a debug build with -O0 and -ggdb -fdebug-default-version=4 | |
- flavor: debug_unopt | |
runtime-mode: debug | |
unoptimized: true | |
build-gen-snapshot: false | |
- flavor: debug | |
runtime-mode: debug | |
unoptimized: false | |
build-gen-snapshot: false | |
- flavor: profile | |
runtime-mode: profile | |
unoptimized: false | |
build-gen-snapshot: true | |
- flavor: release | |
runtime-mode: release | |
unoptimized: false | |
build-gen-snapshot: true | |
# Pi 3 is a Cortex A53. | |
# -mcpu=cortex-a53 -mtune=cortex-a53 | |
- artifact-name: pi3 | |
cpu: arm | |
arm-cpu: cortex-a53+nocrypto | |
arm-tune: cortex-a53 | |
gen-snapshot-path: clang_x64/gen_snapshot | |
- artifact-name: pi3-64 | |
cpu: arm64 | |
arm-cpu: cortex-a53+nocrypto | |
arm-tune: cortex-a53 | |
gen-snapshot-path: clang_x64/gen_snapshot | |
# Pi 4 is a Cortex-A72, but doesn't support cryptography instructions. | |
# Use -mcpu=cortex-a72+nocrypto -mtune=cortex-a72 | |
- artifact-name: pi4 | |
cpu: arm | |
arm-cpu: cortex-a72+nocrypto | |
arm-tune: cortex-a72 | |
gen-snapshot-path: clang_x64/gen_snapshot | |
- artifact-name: pi4-64 | |
cpu: arm64 | |
arm-cpu: cortex-a72+nocrypto | |
arm-tune: cortex-a72 | |
gen-snapshot-path: clang_x64/gen_snapshot | |
# Use -mcpu=generic -mtune=generic for the generic builds. | |
- artifact-name: armv7-generic | |
cpu: arm | |
arm-cpu: generic | |
arm-tune: generic | |
gen-snapshot-path: clang_x64/gen_snapshot | |
- artifact-name: aarch64-generic | |
cpu: arm64 | |
arm-cpu: generic | |
arm-tune: generic | |
gen-snapshot-path: clang_x64/gen_snapshot | |
- artifact-name: x64-generic | |
cpu: x64 | |
# For x64, we need to differentiate between ubuntu and macos host. | |
# For ubuntu x64, the gen_snapshot target is just gen_snapshot, | |
# for macOS x64, the gen_snapshot target is clang_x64/gen_snapshot. | |
- os: ubuntu-latest | |
artifact-name: x64-generic | |
gen-snapshot-path: gen_snapshot | |
- os: macos-latest | |
artifact-name: x64-generic | |
gen-snapshot-path: clang_x64/gen_snapshot | |
# One-off job for building the universal artifacts. | |
- artifact-name: universal | |
os: ubuntu-latest | |
# flavor: | |
# unoptimized: | |
# runtime-mode: | |
nostripped: false | |
build-engine: false | |
build-gen-snapshot: false | |
build-universal: true | |
split-debug-symbols: false | |
# gen-snapshot-path: | |
# cpu: | |
# arm-cpu: | |
# arm-tune: | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log engine version & Build config | |
run: | | |
echo *** engine version: *** | |
echo ${{ needs.resolve-version.outputs.engine-hash }} | |
echo '*** build config: ***' | |
echo matrix.os: ${{ matrix.os }} | |
echo runner.os: ${{ runner.os }} | |
echo artifact name: ${{ matrix.artifact-name }} | |
echo flavor: ${{ matrix.flavor }} | |
echo runtime-mode: ${{ matrix.runtime-mode }} | |
echo unoptimized: ${{ matrix.unoptimized }} | |
echo no-stripped: ${{ matrix.nostripped }} | |
echo build-engine: ${{ matrix.build-engine }} | |
echo build-gen-snapshot: ${{ matrix.build-gen-snapshot }} | |
echo build-universal: ${{ matrix.build-universal }} | |
echo split debug symbols: ${{ matrix.split-debug-symbols }} | |
echo gen_snapshot path: ${{ matrix.gen-snapshot-path }} | |
echo cpu: ${{ matrix.cpu }} | |
echo arm-cpu: ${{ matrix.arm-cpu }} | |
echo arm-tune: ${{ matrix.arm-tune }} | |
- name: Cache depot tools | |
id: cache-depot-tools | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ github.workspace }}/depot_tools | |
key: ${{ runner.os }}-depot-tools | |
- name: Clone depot tools | |
if: steps.cache-depot-tools.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth 1 \ | |
https://chromium.googlesource.com/chromium/tools/depot_tools.git \ | |
${{ github.workspace }}/depot_tools | |
- name: Setup depot tools | |
run: | | |
echo GCLIENT_PY3=1 >> $GITHUB_ENV | |
echo DEPOT_TOOLS_UPDATE=0 >> $GITHUB_ENV | |
echo $GITHUB_WORKSPACE/depot_tools >> $GITHUB_PATH | |
- name: Run gclient --version | |
run: | | |
gclient --version | |
- name: Download cached engine sources | |
uses: actions/cache/restore@v3 | |
id: cache | |
env: | |
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10 | |
with: | |
path: engine | |
key: engine-${{ needs.resolve-version.outputs.engine-hash }}-${{ runner.os }} | |
fail-on-cache-miss: true | |
- name: Apply patches | |
working-directory: engine/src | |
# use git apply instead of git am to avoid `Committer identity unknown` error | |
run: | | |
echo Applying buildroot patches... | |
git apply $GITHUB_WORKSPACE/buildroot-patches/*.patch | |
git status | |
pushd flutter | |
echo Applying engine patches... | |
git apply $GITHUB_WORKSPACE/engine-patches/*.patch | |
git status | |
popd && pushd third_party/dart | |
git apply $GITHUB_WORKSPACE/dart-patches/*.patch | |
git status | |
# This can't be done in the prepopulate step since on MacOS, it depends | |
# on a buildroot patch. | |
- name: Download linux sysroot | |
working-directory: engine/src/build/linux/sysroot_scripts | |
if: matrix.cpu | |
timeout-minutes: 5 | |
run: ./install-sysroot.py --arch=${{ matrix.cpu == 'x64' && 'amd64' || matrix.cpu }} | |
- name: Override PKGCONFIG_PATH for linux arm | |
if: matrix.cpu == 'arm' | |
run: | |
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/engine/src/build/linux/debian_sid_arm-sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig" >> "$GITHUB_ENV" | |
- name: Configure engine | |
working-directory: engine | |
run: | | |
./src/flutter/tools/gn \ | |
${{ matrix.runtime-mode && format('--runtime-mode {0}', matrix.runtime-mode) || '' }} \ | |
${{ matrix.cpu && '--target-os linux' || '' }} \ | |
${{ matrix.cpu && format('--linux-cpu {0}', matrix.cpu) || '' }} \ | |
${{ matrix.cpu == 'arm' && '--arm-float-abi hard' || ''}} \ | |
--target-dir build \ | |
--embedder-for-target \ | |
--disable-desktop-embeddings \ | |
--no-build-glfw-shell \ | |
--no-build-embedder-examples \ | |
--no-enable-unittests \ | |
--no-goma \ | |
${{ matrix.unoptimized && '--unoptimized' || ''}} \ | |
${{ matrix.nostripped && '--no-stripped' || ''}} | |
# TODO: Use --gn-args argument to specify arm_cpu and arm_tune. | |
- name: Append arm_cpu & arm_tune args | |
if: ${{ matrix.arm-cpu || matrix.arm-tune }} | |
working-directory: engine/src/out/build/ | |
run: | | |
echo 'arm_cpu = "${{ matrix.arm-cpu }}"' >> args.gn | |
echo 'arm_tune = "${{ matrix.arm-tune }}"' >> args.gn | |
echo '*** args.gn file: ***' | |
cat args.gn | |
echo '*** rerunning gn gen ***' | |
gn gen --export-compile-commands . | |
- name: Build engine | |
shell: bash | |
working-directory: engine/src/out/build | |
run: | | |
ninja \ | |
${{ matrix.build-engine && 'libflutter_engine.so' || '' }} \ | |
${{ matrix.build-gen-snapshot && matrix.gen-snapshot-path || '' }} \ | |
${{ matrix.build-universal && 'flutter_embedder.h icudtl.dat' || '' }} | |
- name: Add engine.version and dart-sdk.version file | |
if: matrix.build-universal | |
env: | |
BUILD_DIR: ${{ github.workspace }}/engine/src/out/build/ | |
run: | | |
cp engine.version.stable $BUILD_DIR/engine.version | |
pushd ${{ github.workspace }}/engine/src/third_party/dart | |
git rev-parse HEAD > $BUILD_DIR/dart-sdk.version | |
popd | |
- name: Split debug symbols | |
if: matrix.build-engine && matrix.split-debug-symbols | |
working-directory: ${{ github.workspace }}/engine/src/out/build/ | |
run: | | |
OBJCOPY='${{ github.workspace }}/engine/src/buildtools/linux-x64/clang/bin/llvm-objcopy' | |
$OBJCOPY --only-keep-debug libflutter_engine.so libflutter_engine.dbgsyms | |
$OBJCOPY --strip-debug libflutter_engine.so | |
$OBJCOPY --add-gnu-debuglink=libflutter_engine.dbgsyms libflutter_engine.so | |
- name: Package engine | |
if: matrix.build-engine | |
env: | |
BUILD_DIR: ${{ github.workspace }}/engine/src/out/build/ | |
XZ_DEFAULTS: "-T 0" | |
run: | | |
mkdir -p pkg-engine | |
pushd pkg-engine | |
cp $BUILD_DIR/libflutter_engine.so . | |
tar -cJvf ../engine-${{ matrix.artifact-name }}-${{ matrix.flavor }}.tar.xz * | |
- name: Package engine debug symbols | |
if: matrix.build-engine && matrix.split-debug-symbols | |
env: | |
BUILD_DIR: ${{ github.workspace }}/engine/src/out/build/ | |
XZ_DEFAULTS: "-T 0" | |
run: | | |
mkdir -p pkg-engine-dbgsyms | |
pushd pkg-engine-dbgsyms | |
cp \ | |
$BUILD_DIR/compile_commands.json \ | |
$BUILD_DIR/libflutter_engine.dbgsyms \ | |
. | |
tar -cJvf ../engine-dbgsyms-${{ matrix.artifact-name }}-${{ matrix.flavor }}.tar.xz * | |
- name: Package gen_snapshot | |
if: matrix.build-gen-snapshot | |
env: | |
BUILD_DIR: ${{ github.workspace }}/engine/src/out/build/ | |
XZ_DEFAULTS: "-T 0" | |
run: | | |
mkdir -p pkg-gen-snapshot | |
pushd pkg-gen-snapshot | |
cp $BUILD_DIR/${{ matrix.gen-snapshot-path }} $BUILD_DIR/compile_commands.json . | |
tar -cJvf ../gen-snapshot-${{ runner.os }}-${{ runner.arch }}-${{ matrix.artifact-name }}-${{ matrix.flavor }}.tar.xz * | |
- name: Package universal artifacts | |
if: matrix.build-universal | |
env: | |
BUILD_DIR: ${{ github.workspace }}/engine/src/out/build/ | |
XZ_DEFAULTS: "-T 0" | |
run: | | |
mkdir -p pkg-universal | |
pushd pkg-universal | |
cp \ | |
$BUILD_DIR/icudtl.dat \ | |
$BUILD_DIR/flutter_embedder.h \ | |
$BUILD_DIR/engine.version \ | |
$BUILD_DIR/dart-sdk.version \ | |
. | |
tar -cJvf ../universal.tar.xz * | |
- name: Upload gen_snapshot | |
if: matrix.build-gen-snapshot | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gen-snapshot-${{ runner.os }}-${{ matrix.artifact-name }}-${{ matrix.flavor }} | |
path: pkg-gen-snapshot/* | |
- name: Upload gen_snapshot (.tar.xz) | |
if: matrix.build-gen-snapshot | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gen-snapshot-${{ runner.os }}-${{ runner.arch }}-${{ matrix.artifact-name }}-${{ matrix.flavor }}-tar-xz | |
path: gen-snapshot-${{ runner.os }}-${{ runner.arch }}-${{ matrix.artifact-name }}-${{ matrix.flavor }}.tar.xz | |
- name: Upload engine | |
if: matrix.build-engine | |
uses: actions/upload-artifact@v3 | |
with: | |
name: engine-${{ matrix.artifact-name }}-${{ matrix.flavor }} | |
path: pkg-engine/* | |
- name: Upload engine (.tar.xz) | |
if: matrix.build-engine | |
uses: actions/upload-artifact@v3 | |
with: | |
name: engine-${{ matrix.artifact-name }}-${{ matrix.flavor }}-tar-xz | |
path: engine-${{ matrix.artifact-name }}-${{ matrix.flavor }}.tar.xz | |
- name: Upload engine debug symbols | |
if: matrix.build-engine | |
uses: actions/upload-artifact@v3 | |
with: | |
name: engine-${{ matrix.artifact-name }}-${{ matrix.flavor }} | |
path: pkg-engine-dbgsyms/* | |
- name: Upload engine debug symbols (.tar.xz) | |
if: matrix.build-engine | |
uses: actions/upload-artifact@v3 | |
with: | |
name: engine-dbgsyms-${{ matrix.artifact-name }}-${{ matrix.flavor }}-tar-xz | |
path: engine-dbgsyms-${{ matrix.artifact-name }}-${{ matrix.flavor }}.tar.xz | |
- name: Upload universal artifacts | |
if: matrix.build-universal | |
uses: actions/upload-artifact@v3 | |
with: | |
name: universal | |
path: pkg-universal/* | |
- name: Upload universal artifacts (.tar.xz) | |
if: matrix.build-universal | |
uses: actions/upload-artifact@v3 | |
with: | |
name: universal-tar-xz | |
path: universal.tar.xz | |
package: | |
name: 'Package artifacts' | |
runs-on: ubuntu-latest | |
needs: [build, resolve-version] | |
strategy: | |
matrix: | |
artifact-name: | |
- pi3 | |
- pi3-64 | |
- pi4 | |
- pi4-64 | |
- armv7-generic | |
- aarch64-generic | |
- x64-generic | |
include: | |
# For each artifact (target), we also have an architecture-generic variant. | |
# We use those for debug & debug_unopt, since we don't actually build architecture-specific | |
# artifacts there. | |
- artifact-name: pi3 | |
generic-arch-artifact-name: armv7-generic | |
- artifact-name: pi3-64 | |
generic-arch-artifact-name: aarch64-generic | |
- artifact-name: pi4 | |
generic-arch-artifact-name: armv7-generic | |
- artifact-name: pi4-64 | |
generic-arch-artifact-name: aarch64-generic | |
- artifact-name: armv7-generic | |
generic-arch-artifact-name: armv7-generic | |
- artifact-name: aarch64-generic | |
generic-arch-artifact-name: aarch64-generic | |
- artifact-name: x64-generic | |
generic-arch-artifact-name: x64-generic | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log engine version & Build config | |
run: | | |
echo *** engine version: *** | |
echo ${{ needs.resolve-version.outputs.engine-hash }} | |
echo '*** config: ***' | |
echo artifact name: ${{ matrix.artifact-name }} | |
echo generic-arch-artifact-name: ${{ matrix.generic-arch-artifact-name }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: universal | |
path: universal | |
- uses: actions/download-artifact@v3 | |
with: | |
name: engine-${{ matrix.generic-arch-artifact-name }}-debug | |
path: debug | |
- uses: actions/download-artifact@v3 | |
with: | |
name: engine-${{ matrix.generic-arch-artifact-name }}-debug_unopt | |
path: debug_unopt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: engine-${{ matrix.artifact-name }}-profile | |
path: profile | |
- uses: actions/download-artifact@v3 | |
with: | |
name: engine-${{ matrix.artifact-name }}-release | |
path: release | |
- uses: actions/download-artifact@v3 | |
with: | |
name: gen-snapshot-Linux-${{ matrix.generic-arch-artifact-name }}-profile | |
path: linux-gen-snapshot-profile | |
- uses: actions/download-artifact@v3 | |
with: | |
name: gen-snapshot-Linux-${{ matrix.generic-arch-artifact-name }}-release | |
path: linux-gen-snapshot-release | |
- uses: actions/download-artifact@v3 | |
with: | |
name: gen-snapshot-macOS-${{ matrix.generic-arch-artifact-name }}-profile | |
path: macos-gen-snapshot-profile | |
- uses: actions/download-artifact@v3 | |
with: | |
name: gen-snapshot-macOS-${{ matrix.generic-arch-artifact-name }}-release | |
path: macos-gen-snapshot-release | |
- name: Package artifacts | |
env: | |
XZ_DEFAULTS: "-T 0" | |
run: | | |
mkdir -p pkg | |
pushd pkg | |
mv ../engine.version.stable ./engine.version | |
mv ../debug_unopt/libflutter_engine.so ./libflutter_engine.so.debug_unopt | |
mv ../debug/libflutter_engine.so ./libflutter_engine.so.debug | |
mv ../profile/libflutter_engine.so ./libflutter_engine.so.profile | |
mv ../release/libflutter_engine.so ./libflutter_engine.so.release | |
mv ../universal/flutter_embedder.h ./flutter_embedder.h | |
mv ../universal/icudtl.dat ./icudtl.dat | |
mv ../universal/engine.version ./engine.version | |
mv ../universal/dart-sdk.version ./dart-sdk.version | |
# We previously copied <build-dir>/clang_x64/gen_snapshot to <build-dir>/gen_snapshot, | |
# so we don't need the clang_x64 part here. | |
mv ../linux-gen-snapshot-profile/gen_snapshot ./gen_snapshot_linux_x64_profile | |
mv ../linux-gen-snapshot-release/gen_snapshot ./gen_snapshot_linux_x64_release | |
mv ../macos-gen-snapshot-profile/gen_snapshot ./gen_snapshot_macos_x64_profile | |
mv ../macos-gen-snapshot-release/gen_snapshot ./gen_snapshot_macos_x64_release | |
# The github actions artifact uploader/downloader don't keep the file permissions, so we need to mak | |
# the binaries executable again. | |
# We tar the files afterwards though, which keeps the permissions. | |
chmod +x ./libflutter_engine.so* ./gen_snapshot* | |
tar -cJvf ../${{ matrix.artifact-name }}.tar.xz * | |
popd | |
- name: Package debug symbols | |
env: | |
XZ_DEFAULTS: "-T 0" | |
run: | | |
mkdir -p pkg-dbgsyms | |
pushd pkg-dbgsyms | |
mv ../debug_unopt/libflutter_engine.dbgsyms ./libflutter_engine.debug_unopt.dbgsyms | |
mv ../debug/libflutter_engine.dbgsyms ./libflutter_engine.debug.dbgsyms | |
mv ../profile/libflutter_engine.dbgsyms ./libflutter_engine.profile.dbgsyms | |
mv ../release/libflutter_engine.dbgsyms ./libflutter_engine.release.dbgsyms | |
tar -cJvf ../${{ matrix.artifact-name }}-dbgsyms.tar.xz * | |
popd | |
# Show the complete file tree, and print all metadata (permissions, owner, group, filesize, last modification date) | |
- name: Show file tree | |
run: | | |
sudo apt-get install -y tree | |
tree -apugshDF | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: | | |
pkg/engine.version | |
pkg/libflutter_engine.so.debug_unopt | |
pkg/libflutter_engine.so.debug | |
pkg/libflutter_engine.so.profile | |
pkg/libflutter_engine.so.release | |
pkg/flutter_embedder.h | |
pkg/icudtl.dat | |
pkg/engine.version | |
pkg/dart-sdk.version | |
pkg/gen_snapshot_linux_x64_profile | |
pkg/gen_snapshot_linux_x64_release | |
pkg/gen_snapshot_macos_x64_profile | |
pkg/gen_snapshot_macos_x64_release | |
- name: Upload artifacts (.tar.xz) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }}-tar-xz | |
path: | | |
${{ matrix.artifact-name }}.tar.xz | |
- name: Upload debug symbols (.tar.xz) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }}-dbgsyms-tar-xz | |
path: | | |
${{ matrix.artifact-name }}-dbgsyms.tar.xz | |
build-app: | |
name: 'Build test app' | |
runs-on: ${{ matrix.os }} | |
needs: [resolve-version, package] | |
strategy: | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
artifact-name: | |
- pi3 | |
- pi3-64 | |
- pi4 | |
- pi4-64 | |
- armv7-generic | |
- aarch64-generic | |
flavor: | |
- debug_unopt | |
- debug | |
- profile | |
- release | |
include: | |
- flavor: debug_unopt | |
runtime-mode: debug | |
- flavor: debug | |
runtime-mode: debug | |
- flavor: profile | |
runtime-mode: profile | |
- flavor: release | |
runtime-mode: release | |
- artifact-name: pi3 | |
arch: armv7 | |
- artifact-name: pi3-64 | |
arch: aarch64 | |
- artifact-name: pi4 | |
arch: armv7 | |
- artifact-name: pi4-64 | |
arch: aarch64 | |
- artifact-name: armv7-generic | |
arch: armv7 | |
- artifact-name: aarch64-generic | |
arch: aarch64 | |
steps: | |
- uses: actions/checkout@v3 | |
# TODO: Use the exact flutter version here | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ needs.resolve-version.outputs.first-semver }} | |
cache: true | |
- name: Determine flutter SDK path | |
run: | | |
FLUTTER_SDK_PATH=$(dirname $(dirname $(which flutter))) | |
echo flutter sdk path: "$FLUTTER_SDK_PATH" | |
echo "FLUTTER_SDK_PATH=$FLUTTER_SDK_PATH" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: binaries | |
# Seems like this is necessary. Maybe it's not if we use a tar-file instead. | |
- name: Make binaries executable | |
working-directory: binaries | |
run: | | |
chmod +x ./libflutter_engine.so* ./gen_snapshot* | |
# Show the complete file tree, and print all metadata (permissions, owner, group, filesize, last modification date) | |
- name: Show file tree | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -y tree | |
tree -apugshDF | |
- working-directory: test_app | |
run: | | |
flutter pub get | |
flutter build bundle | |
cp ../binaries/libflutter_engine.so.${{ matrix.flavor }} build/flutter_assets/libflutter_engine.so | |
cp ../binaries/icudtl.dat build/flutter_assets/ | |
- name: Build AOT bundle | |
if: matrix.runtime-mode == 'profile' || matrix.runtime-mode == 'release' | |
working-directory: test_app | |
run: | | |
$FLUTTER_SDK_PATH/bin/cache/dart-sdk/bin/dart \ | |
$FLUTTER_SDK_PATH/bin/cache/dart-sdk/bin/snapshots/frontend_server.dart.snapshot \ | |
--sdk-root $FLUTTER_SDK_PATH/bin/cache/artifacts/engine/common/flutter_patched_sdk${{ matrix.runtime-mode == 'release' && '_product' || '' }} \ | |
--target=flutter \ | |
--aot --tfa \ | |
-Ddart.vm.product=${{ matrix.runtime-mode == 'release' && 'true' || 'false' }} \ | |
-Ddart.vm.profile=${{ matrix.runtime-mode == 'profile' && 'true' || 'false' }} \ | |
--packages .dart_tool/package_config.json \ | |
--output-dill build/kernel_snapshot.dill \ | |
--verbose \ | |
--depfile build/kernel_snapshot.d \ | |
package:test_app/main.dart | |
../binaries/gen_snapshot_${{ matrix.os == 'macos-latest' && 'macos_x64' || 'linux_x64' }}_${{ matrix.runtime-mode }} \ | |
--deterministic \ | |
--snapshot_kind=app-aot-elf \ | |
--elf=build/flutter_assets/app.so \ | |
--strip \ | |
${{ matrix.arch == 'armv7' && '--sim-use-hardfp' || '' }} \ | |
--verbose \ | |
build/kernel_snapshot.dill | |
- name: Copy asset bundle | |
run: | | |
cp -r test_app/build/flutter_assets app-assets | |
- name: Upload app assets | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }}-${{ matrix.artifact-name }}-${{ matrix.flavor }}-app-assets | |
path: app-assets | |
test-app: | |
name: 'Test app on a Raspberry Pi' | |
runs-on: ${{ matrix.runner }} | |
needs: [build-app] | |
strategy: | |
matrix: | |
os: | |
- Linux | |
- macOS | |
artifact-name: | |
# - pi3 | |
- pi3-64 | |
# - pi4 | |
- pi4-64 | |
# - armv7-generic | |
- aarch64-generic | |
flavor: | |
- debug_unopt | |
- debug | |
- profile | |
- release | |
include: | |
- flavor: debug_unopt | |
runtime-mode: debug | |
- flavor: debug | |
runtime-mode: debug | |
- flavor: profile | |
runtime-mode: profile | |
- flavor: release | |
runtime-mode: release | |
# - artifact-name: pi3 | |
# runner: pi4-32 | |
- artifact-name: pi3-64 | |
runner: pi4-64 | |
# - artifact-name: pi4 | |
# runner: pi4-32 | |
- artifact-name: pi4-64 | |
runner: pi4-64 | |
# - artifact-name: armv7-generic | |
# runner: pi4-32 | |
- artifact-name: aarch64-generic | |
runner: pi4-64 | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.artifact-name }}-${{ matrix.flavor }}-app-assets | |
path: app | |
- uses: actions/checkout@v3 | |
with: | |
repository: ardera/flutter-pi | |
path: flutter-pi | |
- name: Configure | |
working-directory: flutter-pi | |
run: | | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -S. -Bbuild | |
- name: Build | |
working-directory: flutter-pi/build | |
run: ninja | |
# The app should quit with exit code 0 by itself. | |
- name: Run app | |
timeout-minutes: 3 | |
run: | | |
flutter-pi/build/flutter-pi ${{ (matrix.runtime-mode == 'release' && '--release') || (matrix.runtime-mode == 'profile' && '--profile') || '' }} app | |
push-old-repo: | |
name: 'Push binaries to old engine binaries repo' | |
runs-on: ubuntu-latest | |
needs: [resolve-version, package, test-app] | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log engine version | |
run: | | |
echo *** engine version: *** | |
echo ${{ needs.resolve-version.outputs.engine-hash }} | |
- uses: actions/checkout@v3 | |
with: | |
repository: ardera/flutter-engine-binaries-for-arm | |
token: ${{ secrets.OLD_ENGINE_BINARIES_REPO_TOKEN }} | |
path: engine-binaries | |
ref: main | |
- uses: actions/download-artifact@v3 | |
with: | |
name: armv7-generic | |
path: engine-binaries/arm | |
- uses: actions/download-artifact@v3 | |
with: | |
name: aarch64-generic | |
path: engine-binaries/arm64 | |
- working-directory: engine-binaries | |
run: | | |
mv arm/flutter_embedder.h flutter_embedder.h | |
rm arm64/flutter_embedder.h | |
rm arm/*.debug_unopt | |
rm arm64/*.debug_unopt | |
- name: Log flutter version | |
run: | | |
echo flutter semvers: ${{ fromJson(needs.resolve-version.outputs.sdk-semvers) }} | |
- name: Commit new stable engine version | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
cwd: ./engine-binaries | |
message: 'update engine binaries for flutter ${{ join(fromJson(needs.resolve-version.outputs.sdk-semvers)) }}' | |
tag: engine_${{ needs.resolve-version.outputs.engine-hash }} --force | |
tag_push: '--force' | |
release: | |
name: 'Publish release' | |
runs-on: ubuntu-latest | |
needs: [resolve-version, package, test-app] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log engine version | |
run: | | |
echo *** engine version: *** | |
echo ${{ needs.resolve-version.outputs.engine-hash }} | |
- uses: actions/download-artifact@v3 | |
with: | |
path: all-artifacts | |
- run: | | |
mkdir -p release-files | |
mv all-artifacts/*-tar-xz/* release-files/ | |
# Show the complete file tree, and print all metadata (permissions, owner, group, filesize, last modification date) | |
- name: Show file tree | |
run: | | |
sudo apt-get install -y tree | |
tree -apugshDF | |
- uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ join(fromJson(needs.resolve-version.outputs.sdk-semvers)) }} | |
body: | | |
| name | info | reference | | |
| - | - | - | | |
| flutter channel | stable | | | |
| flutter version | ${{ needs.resolve-version.outputs.first-semver }} | [flutter/flutter@`${{ needs.resolve-version.outputs.first-semver }}`](https://github.com/flutter/flutter/tree/${{ needs.resolve-version.outputs.first-semver }}) | | |
| engine version | ${{ needs.resolve-version.outputs.first-semver }} | [flutter/engine@`${{ needs.resolve-version.outputs.first-semver }}`](https://github.com/flutter/engine/tree/${{ needs.resolve-version.outputs.first-semver }}) | | |
fail_on_unmatched_files: true | |
files: | | |
release-files/* |