Skip to content

Test official plugins #54

Test official plugins

Test official plugins #54

name: Test official plugins
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Every day at midnight UTC
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Get all official plugins
id: generate-matrix
run: |
# generate mocks
flutter pub get
flutter pub run build_runner build
# Run the flutter-test script
ALL_PLUGINS=$(flutter test --no-pub --reporter silent test/utils/print_all_official_plugins.dart)
echo "All plugins: $ALL_PLUGINS"
echo "matrix=$ALL_PLUGINS" >> "$GITHUB_OUTPUT"
run-jobs:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
# don't cancel other tests if one fails
fail-fast: false
matrix:
plugin: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Testing ${{ matrix.plugin }}
run: |
# suppress analytics warning
flutter config --no-analytics
flutter pub get
flutter pub run build_runner build
PLUGIN=${{ matrix.plugin }} flutter test --no-pub test/official_plugins_test.dart
- name: Upload dumps
# This ensures the dumps are uploaded even if the testing will cause the job to fail
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.plugin }}_dumps
path: dumps/