-
Notifications
You must be signed in to change notification settings - Fork 21
70 lines (67 loc) · 2.35 KB
/
golden_test_generation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: "Golden test generation - Examples"
on:
workflow_dispatch:
inputs:
package:
description: 'The name of the package'
required: true
type: choice
options:
- booking_app
- todoapp
- rx_bloc_cli_generated_project
jobs:
example_project:
if: inputs.package != 'rx_bloc_cli_generated_project'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- run: dart --version
- run: flutter --version
- name: Install Dependencies
working-directory: "examples/${{ inputs.package }}"
run: dart pub get
- name: Build Runner Build
working-directory: "examples/${{ inputs.package }}"
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Analyze
working-directory: "examples/${{ inputs.package }}"
run: flutter analyze lib
- name: Generate golden files
working-directory: "examples/${{ inputs.package }}"
run: flutter test --update-goldens
- name: Upload test directory
uses: actions/upload-artifact@v3
with:
name: "${{ inputs.package }}_tests"
path: "examples/${{ inputs.package }}/test/"
rx_bloc_cli_project:
if: inputs.package == 'rx_bloc_cli_generated_project'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- run: dart --version
- run: flutter --version
- name: Generate rx_bloc_cli project
working-directory: "packages/rx_bloc_cli"
run: |
bin/compile_bundles.sh
bin/generate_test_project.sh all_enabled
- name: Generate golden files
working-directory: "packages/rx_bloc_cli/example/testapp"
run: flutter test --update-goldens
- name: Upload test directory
uses: actions/upload-artifact@v3
with:
name: "${{ inputs.package }}_tests"
path: "packages/rx_bloc_cli/example/testapp/test/"