Golden test generation - Examples #30
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: "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/" |