diff --git a/.github/actions/setup_flutter/action.yaml b/.github/actions/setup_flutter/action.yaml index a57cbfd1..3f44645c 100644 --- a/.github/actions/setup_flutter/action.yaml +++ b/.github/actions/setup_flutter/action.yaml @@ -6,6 +6,10 @@ inputs: description: "The working directory where the Flutter project is located." required: false default: "." + version: + description: "The version of Flutter to install." + required: false + default: "3.x" runs: using: "composite" @@ -14,7 +18,7 @@ runs: uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: 3.x + flutter-version: ${{ inputs.version }} cache: true - name: Flutter version diff --git a/.github/workflows/code_check.yaml b/.github/workflows/code_check.yaml index 87509da6..6699b840 100644 --- a/.github/workflows/code_check.yaml +++ b/.github/workflows/code_check.yaml @@ -9,7 +9,6 @@ env: PATTERN_CHECKER: ${{github.workspace}}/scripts/pattern_checker.sh jobs: - # Change detection setup: runs-on: ubuntu-latest permissions: @@ -46,17 +45,23 @@ jobs: echo "lowest-flutter-version=${{ steps.flutter-version-constraint.outputs.lowest }}" echo "highest-flutter-version=${{ steps.flutter-version-constraint.outputs.highest }}" - # Static code analysis analysis: needs: setup if: ${{ needs.setup.outputs.flutter-file-changed == 'true' }} runs-on: ubuntu-latest + strategy: + matrix: + flutter-version: + - ${{ needs.setup.outputs.lowest-flutter-version }} + - ${{ needs.setup.outputs.highest-flutter-version }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Flutter uses: ./.github/actions/setup_flutter + with: + version: ${{ matrix.flutter-version }} - name: Format run: dart format . -o none --set-exit-if-changed @@ -67,7 +72,6 @@ jobs: - name: Disallowed patterns check run: bash ${{ env.PATTERN_CHECKER }} "*.dart" "--" "debugPrint" - # Unit testing testing: needs: setup if: ${{ needs.setup.outputs.flutter-file-changed == 'true' }} @@ -76,12 +80,19 @@ jobs: contents: read actions: read checks: write + strategy: + matrix: + flutter-version: + - ${{ needs.setup.outputs.lowest-flutter-version }} + - ${{ needs.setup.outputs.highest-flutter-version }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Flutter uses: ./.github/actions/setup_flutter + with: + version: ${{ matrix.flutter-version }} - name: Run unit tests run: flutter test --file-reporter="json:${{ env.FLUTTER_TEST_REPORT }}" @@ -91,7 +102,7 @@ jobs: # PRs from forks have no write permissions. if: github.event.pull_request.head.repo.fork == false && (success() || failure()) with: - name: Test Report + name: Test Report (with Flutter ${{ matrix.flutter-version }}) path: ${{ env.FLUTTER_TEST_REPORT }} reporter: flutter-json