diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index bc8dd0ae892..1ed33688bf7 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,10 +8,15 @@ concurrency: jobs: dart-ci: - name: Dart CI + name: Dart CI (${{ matrix.dependencies }}) runs-on: ubuntu-24.04 permissions: packages: write + strategy: + matrix: + dependencies: + - upgrade + - downgrade steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 @@ -41,6 +46,9 @@ jobs: git --no-pager diff exit 1 fi + - name: Downgrade dependencies + if: ${{ matrix.dependencies == 'downgrade' }} + run: melos exec dart pub downgrade - name: Check formatting run: melos run format:check - name: Lint code @@ -65,6 +73,7 @@ jobs: fi - name: Setup Codecov + if: ${{ matrix.dependencies == 'upgrade' }} run: | cd /tmp curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import @@ -78,14 +87,9 @@ jobs: mkdir /tmp/bin mv codecov /tmp/bin - name: Upload coverage to Codecov + if: ${{ matrix.dependencies == 'upgrade' }} run: | export PATH="$PATH:/tmp/bin" melos exec --file-exists="coverage/lcov.info" --concurrency=1 -- " codecov --verbose upload-process --fail-on-error -F MELOS_PACKAGE_NAME -f MELOS_PACKAGE_PATH/coverage/lcov.info -t ${{ secrets.CODECOV_TOKEN }} " - - # Run as the last step to avoid running any other steps with downgraded dependencies - - name: Lint code with downgraded dependencies - run: | - melos exec dart pub downgrade - melos run analyze