Skip to content

Commit

Permalink
ci: Run all Dart steps with both upgraded and downgraded dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Oct 2, 2024
1 parent 88ede25 commit f11a16a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit f11a16a

Please sign in to comment.