Skip to content

Commit a3150a3

Browse files
committed
Run master test in the same workflow
1 parent 4b882c9 commit a3150a3

File tree

2 files changed

+56
-23
lines changed

2 files changed

+56
-23
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Performance Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
branch:
7+
type: string
8+
required: true
9+
artifact_name:
10+
type: string
11+
required: true
12+
13+
jobs:
14+
test:
15+
runs-on: macOS-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
ref: ${{inputs.branch}}
20+
21+
- uses: subosito/flutter-action@v2
22+
with:
23+
flutter-version: "3.24.0"
24+
cache: true
25+
# Manually Update this `key`
26+
cache-key: "3.24.0"
27+
28+
- name: Run performance tests
29+
working-directory: ./packages/fleather/example
30+
run: |
31+
flutter drive -d macos --driver=test_driver/performance_driver.dart --target=integration_test/scrolling_test.dart --profile
32+
flutter drive -d macos --driver=test_driver/performance_driver.dart --target=integration_test/editing_test.dart --profile
33+
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: ${{inputs.artifact_name}}
37+
path: ./packages/fleather/example/build/performance_timelines

.github/workflows/performance_test.yaml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,37 @@ on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
test:
7-
runs-on: macOS-latest
7+
runs-on: ubuntu-latest
88

99
steps:
1010
- uses: actions/checkout@v3
1111

1212
- uses: subosito/flutter-action@v2
1313
with:
14-
flutter-version: "3.22.0"
14+
flutter-version: "3.24.0"
1515
cache: true
1616
# Manually Update this `key`
17-
cache-key: "3.22.0-stable"
17+
cache-key: "3.24.0"
1818

19-
- name: Restore reference summary from cache
20-
id: performance_timelines_cache_restore
21-
uses: actions/cache/restore@v4
19+
- uses: ./.github/workflows/_run_performance_test.yaml
2220
with:
23-
path: packages/fleather/example/build/performance_timelines
24-
key: performance_timelines
21+
branch: master
22+
artifact_name: master_performance_timelines
2523

26-
- if: steps.performance_timelines_cache_restore.outputs.cache-hit == 'true'
27-
run: mv packages/fleather/example/build/performance_timelines packages/fleather/example/build/reference_performance_timelines
24+
- uses: ./.github/workflows/_run_performance_test.yaml
25+
with:
26+
branch: ${{github.ref}}
27+
artifact_name: current_ref_performance_timelines
2828

29-
- name: Run performance tests
30-
working-directory: ./packages/fleather/example
31-
run: |
32-
flutter drive -d macos --driver=test_driver/performance_driver.dart --target=integration_test/scrolling_test.dart --profile
33-
flutter drive -d macos --driver=test_driver/performance_driver.dart --target=integration_test/editing_test.dart --profile
29+
- uses: actions/download-artifact@v4
30+
with:
31+
name: master_performance_timelines
32+
- run: mv packages/fleather/example/build/performance_timelines packages/fleather/example/build/reference_performance_timelines
33+
34+
- uses: actions/download-artifact@v4
35+
with:
36+
name: current_ref_performance_timelines
3437

3538
- name: Analyze results
3639
working-directory: ./packages/fleather/example
37-
run: dart run test_utils/analyze_performance_result.dart
38-
39-
- name: Save reference summary
40-
if: github.ref == 'refs/heads/master'
41-
uses: actions/cache/save@v4
42-
with:
43-
path: build/performance_timelines
44-
key: performance_timelines
40+
run: dart run test_utils/analyze_performance_result.dart

0 commit comments

Comments
 (0)