Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: deferred allocator pattern and configurable formatting support #978

feat: deferred allocator pattern and configurable formatting support

feat: deferred allocator pattern and configurable formatting support #978

Workflow file for this run

name: PR Validation
on:
pull_request:
workflow_dispatch:
jobs:
packages:
strategy:
fail-fast: false
matrix:
package:
- gql
- gql_exec
- gql_code_builder_serializers
- gql_build
- gql_code_builder
- gql_link
- gql_dedupe_link
- gql_dio_link
- gql_error_link
- gql_http_link
- gql_websocket_link
- gql_transform_link
- gql_tristate_value
runs-on: ubuntu-latest
container:
image: dart:latest
name: Validate ${{ matrix.package }}
env:
PACKAGE: ${{ matrix.package }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Melos
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
dart pub global activate melos && dart pub get
- name: Bootstrap workspace
run: melos bootstrap --no-flutter
- name: Check formatting
run: melos format --scope $PACKAGE --set-exit-if-changed
- name: Run build runner (if necessary)
run: melos exec --scope $PACKAGE --depends-on=build_runner -- "dart run build_runner build --delete-conflicting-outputs"
- name: Check for build diff
run: |
# Use git status instead of git diff to check for modified files
if git status --porcelain | grep -q "\.gql\.dart$"; then
echo "Generated .gql.dart files have changes that need to be committed"
git status --porcelain | grep "\.gql\.dart$"
exit 1
fi
- name: Analyze package
run: melos analyze --scope $PACKAGE --fatal-warnings
- name: Run tests
run: melos exec --scope $PACKAGE --dir-exists=test -- dart test
examples:
strategy:
fail-fast: false
matrix:
package:
- gql_example_cli
- gql_example_cli_github
- gql_example_build
- gql_example_http_auth_link
- gql_example_dio_link
# gql_example_flutter would require flutter
runs-on: ubuntu-latest
container:
image: dart:latest
name: Validate example ${{ matrix.package }}
env:
PACKAGE: ${{ matrix.package }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Melos
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
dart pub global activate melos && dart pub get
- name: Bootstrap workspace
run: melos bootstrap --no-flutter
- name: Run build runner (if needed)
run: melos exec --scope $PACKAGE --depends-on=build_runner -- dart run build_runner build --delete-conflicting-outputs || true
- name: Check for build diff
run: |
# Use git status instead of git diff to check for modified files
if git status --porcelain | grep -q "\.gql\.dart$"; then
echo "Generated .gql.dart files have changes that need to be committed"
git status --porcelain | grep "\.gql\.dart$"
exit 1
fi
- name: Check formatting
run: melos format --scope $PACKAGE --set-exit-if-changed
- name: Analyze example
run: melos analyze --scope $PACKAGE --fatal-warnings
builder_tests:
strategy:
matrix:
package:
- end_to_end_test
- end_to_end_test_tristate
runs-on: ubuntu-latest
container:
image: dart:latest
name: Validate test ${{ matrix.package }}
env:
PACKAGE: ${{ matrix.package }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Melos
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
dart pub global activate melos && dart pub get
- name: Bootstrap workspace
run: melos bootstrap --no-flutter
- name: Run build runner (if needed)
run: melos exec --scope $PACKAGE --depends-on=build_runner -- dart run build_runner build --delete-conflicting-outputs || true
- name: Check for build diff
run: |
# Use git status instead of git diff to check for modified files
if git status --porcelain | grep -q "\.gql\.dart$"; then
echo "Generated .gql.dart files have changes that need to be committed"
git status --porcelain | grep "\.gql\.dart$"
exit 1
fi
- name: Check formatting
run: melos format --scope $PACKAGE --set-exit-if-changed
- name: Analyze package
run: melos analyze --scope $PACKAGE --fatal-warnings
- name: Run tests
run: melos exec --scope $PACKAGE --dir-exists=test -- dart test