Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add e2e tests for user flows #191

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e2dd208
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
b8c9feb
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
9a6413a
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
48a58b1
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
79641a7
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
ef011d6
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
10bc61c
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
6f10362
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
2844411
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
3cad7bf
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
b775440
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
ae48f19
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
3c90b4b
ci: add e2e tests for user flows
wolfenrain Feb 27, 2023
e0cf658
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
b52e365
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
b2758c6
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
c37fc75
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
e96113c
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
06dda58
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
b733e5a
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
e0cdc0a
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
70926bf
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
f56a7f3
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
d73b345
ci: add e2e tests for user flows
wolfenrain Feb 28, 2023
e7e0e7b
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
b76b5dd
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
73f3823
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
3325d82
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
345543e
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
f03f1bf
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
9bdc764
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
d013c78
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
5c910bb
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
6725564
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
f6bc837
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
73131b1
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
1dfab08
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
9b0d534
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
29e5535
ci: add e2e tests for user flows
wolfenrain Mar 1, 2023
40ea7b1
Merge branch 'main' of github.com:wolfenrain/fluttium into ci/add-e2e…
wolfenrain Mar 1, 2023
8812cce
Merge branch 'main' of github.com:wolfenrain/fluttium into ci/add-e2e…
wolfenrain Mar 1, 2023
11600f7
Merge branch 'main' of github.com:wolfenrain/fluttium into ci/add-e2e…
wolfenrain Mar 1, 2023
153602b
Merge branch 'main' of github.com:wolfenrain/fluttium into ci/add-e2e…
wolfenrain Mar 1, 2023
a489f80
Merge branch 'main' of github.com:wolfenrain/fluttium into ci/add-e2e…
wolfenrain Mar 3, 2023
fe34080
ci: add e2e tests for user flows
wolfenrain Mar 3, 2023
60cfbc8
ci: add e2e tests for user flows
wolfenrain Mar 3, 2023
4ad7476
Merge branch 'main' into ci/add-e2e-tests-for-user-flows
wolfenrain Mar 27, 2023
0ceed41
Merge branch 'main' into ci/add-e2e-tests-for-user-flows
wolfenrain May 13, 2023
7a63696
ci: add e2e tests for user flows
wolfenrain May 13, 2023
a770255
Merge branch 'ci/add-e2e-tests-for-user-flows' of github.com:wolfenra…
wolfenrain May 13, 2023
415ad8b
ci: add e2e tests for user flows
wolfenrain May 13, 2023
c60d733
Merge branch 'main' into ci/add-e2e-tests-for-user-flows
wolfenrain Jun 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/actions/local_fluttium_environment/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Local Fluttium Environment

runs:
using: "composite"
steps:
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- shell: bash
working-directory: tools
run: dart pub get

- shell: bash
run: dart tools/setup_local_environment.dart

- shell: bash
run: dart pub global activate mason_cli

- shell: bash
run: tools/bundle_all_bricks.sh

- shell: bash
run: dart pub global activate --source path packages/fluttium_cli
229 changes: 229 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
name: e2e

on:
workflow_call:

defaults:
run:
working-directory: example

jobs:
flows:
runs-on: ubuntu-latest

outputs:
flows: ${{ steps.flows.outputs.flows }}

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: πŸ•΅οΈ Finding User Flows
id: flows
run: |
flows="["
for flow in ./flows/*.yaml; do
flows="$flows\"$(basename $flow .yaml)\","
done

# Remove last "," and add the closing bracket
if [[ $flows == *, ]]; then
flows="${flows%?}"
fi
flows="$flows]"

echo "flows=$( echo "$flows" )" >> $GITHUB_OUTPUT

ios:
needs: flows

strategy:
matrix:
flow: ${{ fromJSON(needs.flows.outputs.flows) }}
fail-fast: true

runs-on: macos-latest

timeout-minutes: 30

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: 🐦 Setup Local Fluttium Environment
uses: ./.github/actions/local_fluttium_environment

- name: πŸ“¦ Installing packages
run: |
flutter pub get
cd ios && pod install && cd ..

- name: πŸ”§ Setting Up Simulator
id: simulator
uses: futureware-tech/simulator-action@v2
with:
model: 'iPhone 11'

- name: πŸ§ͺ Testing
run: fluttium test --flavor development --target lib/main_development.dart -d ${{ steps.simulator.outputs.udid }} flows/${{ matrix.flow }}.yaml

android:
if: false # TODO: Currently does not work
needs: flows

strategy:
matrix:
flow: ${{ fromJSON(needs.flows.outputs.flows) }}
fail-fast: true

runs-on: macos-latest

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"

- name: 🐦 Setup Local Fluttium Environment
uses: ./.github/actions/local_fluttium_environment

- name: πŸ“¦ Installing packages
run: flutter pub get

- name: AVD Cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29

- name: Cache AVD Snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
avd-name: android
script: echo "Generated AVD snapshot for caching."

- name: πŸ§ͺ Testing
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
avd-name: android
working-directory: example
script: fluttium test --flavor development --target lib/main_development.dart -d android flows/${{ matrix.flow }}.yaml

web:
needs: flows

strategy:
matrix:
flow: ${{ fromJSON(needs.flows.outputs.flows) }}
fail-fast: true

runs-on: ubuntu-latest

timeout-minutes: 30

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: 🐦 Setup Local Fluttium Environment
uses: ./.github/actions/local_fluttium_environment

- name: πŸ“¦ Installing packages
run: flutter pub get

- name: πŸ§ͺ Testing
run: xvfb-run fluttium test --flavor development --target lib/main_development.dart -d chrome flows/${{ matrix.flow }}.yaml

macos:
if: false # TODO: Metal is not supported on macos runners, https://github.com/actions/runner-images/discussions/6138
needs: flows

strategy:
matrix:
flow: ${{ fromJSON(needs.flows.outputs.flows) }}
fail-fast: true

runs-on: macos-latest

timeout-minutes: 30

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: 🐦 Setup Local Fluttium Environment
uses: ./.github/actions/local_fluttium_environment

- name: πŸ“¦ Installing packages
run: |
flutter pub get
cd macos && pod install && cd ..

- name: πŸ§ͺ Testing
run: fluttium test -d macos flows/${{ matrix.flow }}.yaml

linux:
if: false # TODO: tests currently dont work, but locally they do
needs: flows

strategy:
matrix:
flow: ${{ fromJSON(needs.flows.outputs.flows) }}
fail-fast: true

runs-on: ubuntu-latest

timeout-minutes: 30

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: 🐦 Setup Local Fluttium Environment
uses: ./.github/actions/local_fluttium_environment

- name: πŸ“¦ Installing packages
run: |
flutter pub get
sudo apt-get update -y
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev

- name: πŸ§ͺ Testing
run: xvfb-run fluttium test -d linux flows/${{ matrix.flow }}.yaml

windows:
needs: flows

strategy:
matrix:
flow: ${{ fromJSON(needs.flows.outputs.flows) }}
fail-fast: true

runs-on: windows-latest

timeout-minutes: 30

steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: 🐦 Setup Local Fluttium Environment
uses: ./.github/actions/local_fluttium_environment

- name: πŸ“¦ Installing packages
run: flutter pub get

- name: πŸ§ͺ Testing
run: fluttium test -d windows flows/${{ matrix.flow }}.yaml
21 changes: 15 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,7 @@ jobs:
with:
working_directory: actions/${{ matrix.brick }}

# Simply exists to be the final job in the workflow. This is required to
# ensure that the workflow fails if any of the needed jobs fail.
#
# The build and pana job might not spawn but as long as the other jobs
# succeed this job will be considered successful through skipping.
ci:
e2e:
needs:
[
semantic_pull_request,
Expand All @@ -270,6 +265,20 @@ jobs:
build_bricks,
build_actions,
]

if: ${{ contains(join(needs.*.result, ','), 'failure') == 'false' }}
uses: ./.github/workflows/e2e.yaml

# Simply exists to be the final job in the workflow. This is required to
# ensure that the workflow fails if any of the needed jobs fail.
#
# The build and pana job might not spawn but as long as the other jobs
# succeed this job will be considered successful through skipping.
ci:
needs:
[
e2e
]
if: ${{ always() }}

runs-on: ubuntu-latest
Expand Down