Skip to content

Commit

Permalink
ci: flutter CI now compares produced images against references
Browse files Browse the repository at this point in the history
Automatically creates PR to store them
  • Loading branch information
iamsergio committed Dec 8, 2024
1 parent 9886877 commit 2a4e060
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- src/flutter/**
- tests/flutter/**
- examples/flutter/**
- tests/reference-images/**

branches:
- main
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/flutter-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.PAT_KDDW_REFERENCE_SCREENSHOTS }}

- name: Install dependencies on Ubuntu
run: |
Expand All @@ -66,9 +67,36 @@ jobs:
run: |
cd ${{ github.workspace }}/src/flutter/dart
flutter pub get
cd ${{ github.workspace }}/tests/flutter/
flutter test
env:
KDDW_BINDINGS_LIB: ${{ github.workspace }}/build-dev-flutter/lib/libkddockwidgets.so

- name: Setup git author name
run: |
git config --global user.email "kddw@actions"
git config --global user.name "KDDW Actions"
# the reference is always latest main, as submodule sha1 might be lagging
# as it's updated nightly
- name: checkout latest main of ref images
run: |
cd tests/reference-images
git checkout main
- name: Run integration tests
run: |
cd tests/flutter/
flutter pub get
cd ${{ github.workspace }}/build-dev-flutter/
ctest --output-on-failure
xvfb-run flutter test -d linux integration_test/ui_test.dart
env:
KDDW_BINDINGS_LIB: ${{ github.workspace }}/build-dev-flutter/lib/libkddockwidgets.so

- name: Compare against reference images
shell: bash
if: github.event_name == 'pull_request'
run: |
./compare_images.sh
env:
PAT: ${{ secrets.PAT_KDDW_REFERENCE_SCREENSHOTS }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
GH_TOKEN: ${{ github.token }}
8 changes: 6 additions & 2 deletions .github/workflows/valgrind-leakcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ name: Valgrind qtwidgets_leak_test

on:
push:
paths-ignore:
# These are built by another workflow
- src/flutter/**
- tests/flutter/**
- examples/flutter/**
- tests/reference-images/**
branches:
- 2.1
- main
pull_request:
branches:
- 2.1
- main

jobs:
Expand Down
2 changes: 1 addition & 1 deletion tests/reference-images

0 comments on commit 2a4e060

Please sign in to comment.