Skip to content

refactor: Made the documentation and behaviour for disabling components more consistent. #179

refactor: Made the documentation and behaviour for disabling components more consistent.

refactor: Made the documentation and behaviour for disabling components more consistent. #179

Workflow file for this run

name: CI - Pull Request
on:
pull_request:
jobs:
up-to-date:
name: "Check branch is up to date"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Check branch is up to date
run: |
if git merge-base --is-ancestor ${{ github.event.pull_request.base.sha}} ${{ github.event.pull_request.head.sha}}
then
echo "Your branch is up to date."
exit 0
else
echo "You need to merge / rebase."
exit 1
fi
changes:
name: "Check for changes in code"
needs: up-to-date
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
files: ${{steps.changed-files.outputs.any_changed}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
persist-credentials: false
- name: Get all changed *.dart, files in custom-docs or pubspec.yaml
id: changed-files
uses: tj-actions/changed-files@v41
with:
base_sha: ${{ github.event.pull_request.base.sha }}
sha: ${{ github.event.pull_request.head.sha }}
files: |
**/*.dart
custom-docs
pubspec.yaml
code-quality:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- uses: subosito/flutter-action@v2
- name: Setup flutter
run: flutter pub get
- name: Lint and format
run: |
dart format . -l 120
dart fix --apply
flutter analyze
cd example && flutter test
- name: Check for modified files
id: git-check
run: echo "modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> $GITHUB_ENV
- name: Update changes in GitHub repository
if: env.modified == 'true'
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add -A
git commit -m '[automated commit] lint format and import sort'
git push
deploy-preview:
name: Deploy preview version of the storybook on firebase
needs: code-quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: subosito/flutter-action@v2
- name: Setup flutter
run: flutter pub get
- name: Build example app
run: |
cd example
flutter build web -t widgetbook/main.dart -o ../build --no-tree-shake-icons
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}"
channelId: "pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }}"