Skip to content

ci: Run all Dart steps with both upgraded and downgraded dependencies #5125

ci: Run all Dart steps with both upgraded and downgraded dependencies

ci: Run all Dart steps with both upgraded and downgraded dependencies #5125

Workflow file for this run

name: Dart CI
on:
pull_request:
concurrency:
group: dart-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
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
with:
fetch-depth: 0
- name: Login to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
- name: Install SQLite
run: sudo apt-get update && sudo apt-get install libsqlite3-0 libsqlite3-dev -y --no-install-recommends
- name: Install dart
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 # v1
with:
sdk: 3.5
- name: Setup
run: ./tool/setup.sh
- name: Check up-to-date pubspec.lock
run: |
if [ -n "$(git status --porcelain)" ]; then
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
run: melos run analyze
- name: Run tests
run: |
./tool/build-dev-container.sh
melos test
- 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
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
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 }}
"