Skip to content

ci: improve GitHub Actions workflows reliability and performance #68

ci: improve GitHub Actions workflows reliability and performance

ci: improve GitHub Actions workflows reliability and performance #68

name: yet_another_json_isolate
on:
push:
branches:
- main
paths:
- 'packages/yet_another_json_isolate/**'
- '.github/workflows/yet_another_json_isolate.yml'
pull_request:
paths:
- 'packages/yet_another_json_isolate/**'
- '.github/workflows/yet_another_json_isolate.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Test SDK ${{ matrix.sdk }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [stable, beta, dev]
defaults:
run:
working-directory: packages/yet_another_json_isolate
runs-on: ${{ matrix.os }}
steps:
- name: Checks-out repo
uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Cache pub dependencies
uses: actions/cache@v4
with:
path: |
${{ env.PUB_CACHE }}
~/.pub-cache
key: ${{ runner.os }}-pub-${{ matrix.sdk }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-${{ matrix.sdk }}-
${{ runner.os }}-pub-
- name: Bootstrap workspace
run: |
cd ../../
dart pub global activate melos
melos bootstrap --no-flutter
- name: dartfmt
if: ${{ matrix.sdk == 'stable'}}
run: dart format lib test -l 80 --set-exit-if-changed
- name: analyzer
run: |
if [ "${{ matrix.sdk }}" == "stable" ]; then
dart analyze --fatal-warnings --fatal-infos .
else
dart analyze
fi
- name: Run tests
run: dart test