update_goldens #3
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: update_goldens | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to generate goldens from' | |
required: true | |
flutter_version: | |
description: 'Flutter version to use' | |
required: true | |
default: '3.x' | |
jobs: | |
generate-and-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validate branch input | |
run: | | |
BRANCH_PATTERN="^[a-zA-Z0-9/_.-]+$" | |
# Input string (branch name) to be validated | |
BRANCH_NAME=${{ inputs.branch}} | |
echo "Checking branch name: $BRANCH_NAME" | |
# Validate branch name against the regex pattern | |
if [[ $BRANCH_NAME =~ $BRANCH_PATTERN ]]; then | |
echo "Branch name is valid." | |
exit 0 | |
else | |
echo "Branch name is invalid." | |
exit 1 | |
fi | |
- name: Ensure branch is not master | |
if: ${{ github.event.inputs.branch == 'master' || github.event.inputs.branch == 'origin/master'}} | |
run: exit 1 | |
- name: 📚 Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.x" | |
channel: stable | |
cache: true | |
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | |
- name: "Install Tools" | |
run: | | |
flutter pub global activate melos | |
- name: "Bootstrap Workspace" | |
run: melos bootstrap --verbose | |
- name: Update Goldens | |
working-directory: packages/stream_chat_flutter | |
continue-on-error: true | |
run: | | |
flutter test --update-goldens | |
- name: Commit Changes | |
id: commit_changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: Updating Goldens" | |
commit_user_name: github-actions[bot] | |
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com |