feat: Refactor GH actions
RENAME
.github/workflows/packages_tests.yml
.github/workflows/build.yml
-name: Packages sanity check
+name: Build
on:
push:
@@ -8,13 +8,21 @@ on:
jobs:
build:
+ strategy:
+ matrix:
+ channel:
+ - beta
+ - stable
+ - dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
- sdk: stable
+ channel: ${{matrix.channel}}
- name: Install dependencies
run: make dep
- name: Code formatting check
- run: make ci
\ No newline at end of file
+ run: make ci_fmt_client
+ - name: Code formatting check (flutter)
+ run: make ci_fmt_flutter
\ No newline at end of file

RENAME
.github/workflows/graphql_codcoverage.yml
.github/workflows/codcoverage.yml
-name: graphql Code coverage
+name: Codecoverage
on:
push:
@@ -18,9 +18,9 @@ jobs:
- name: Run tests with coverage
run: |
make dep
- make ci_coverage_client
- - name: Upload coverage file
- run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
+ make ci_coverage_client
+ ./codecov
+ make ci_coverage_flutter
./codecov
\ No newline at end of file

DELETE
.github/workflows/graphql_flutter_build.yml
-name: graphql-flutter Dart Code sanity check
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v1
- with:
- channel: 'stable'
- - run: make dep
- - run: make ci_fmt_flutter
\ No newline at end of file

DELETE
.github/workflows/graphql_flutter_codcoverage.yml
-name: graphql-flutter Code coverage
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v1
- with:
- channel: 'stable'
- flutter-version: '2.10.5'
- - run: |
- make dep
- make ci_coverage_flutter
- - name: Upload coverage file
- run: |
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov
\ No newline at end of file

DELETE
.github/workflows/graphql_flutter_tests.yml
-name: graphql_flutter tests case
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v1
- with:
- channel: 'stable'
- flutter-version: '2.10.5'
- - name: Install dependencies
- run: make dep
- - name: Tests
- run: make ci_check_flutter
\ No newline at end of file

DELETE
.github/workflows/graphql_tests.yml
-name: graphql Test case
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v1
- with:
- channel: 'stable'
- - name: Install dependencies
- run: make dep
- - name: Tests
- run: make ci_check_client
\ No newline at end of file

DELETE
.github/workflows/packages_build.yml
-name: Packages sanity check
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v1
- with:
- sdk: stable
- flutter-version: '2.10.5'
- - name: Install dependencies
- run: make dep
- - name: Code formatting check
- run: make analyze
\ No newline at end of file

RENAME
.github/workflows/graphql_release.yml
.github/workflows/release_dart.yml
-name: graphql Release Package
+name: Release (dart)
on:
release:
@@ -8,8 +8,8 @@ on:
push:
workflow_run:
workflows:
- - "graphql Test case"
- - "graphql Dart Code sanity check"
+ - "Test"
+ - "Build"
branches: [ main ]
types:
- completed

RENAME
.github/workflows/graphql_flutter_release.yml
.github/workflows/release_flutter.yml
-name: graphql-flutter Release Package
+name: Release (flutter)
on:
release:
@@ -8,9 +8,8 @@ on:
push:
workflow_run:
workflows:
- - "graphql-flutter Dart Code sanity check"
- - "graphql-flutter Tests case"
- - "graphql Release Package"
+ - "Build"
+ - "Test"
branches: [ main ]
types:
- completed

RENAME
.github/workflows/packages_release.yml
.github/workflows/release_packages.yml
-name: publish packages to pub.dev
+name: Release (packages)
on:
release:

RENAME
.github/workflows/graphql_build.yml
.github/workflows/test.yml
-name: graphql Dart Code sanity check
+name: Test
on:
push:
@@ -16,5 +16,7 @@ jobs:
channel: 'stable'
- name: Install dependencies
run: make dep
- - name: Code formatting check
- run: make ci_fmt_client
\ No newline at end of file
+ - name: Tests (dart)
+ run: make ci_check_client
+ - name: Tests (flutter)
+ run: make ci_check_flutter
\ No newline at end of file

MODIFY
.gitignore
.gitignore
@@ -15,6 +15,7 @@ ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
.flutter-plugins
pubspec.lock
+pubspec_overrides.yaml
# Coverage
coverage.json

MODIFY
melos.yaml
melos.yaml
@@ -11,23 +11,25 @@ scripts:
run: melos exec -c 1 -- "dart format --set-exit-if-changed . && dart analyze . --fatal-infos"
description: Run dart analyzer in a specific package.
select-package:
+ flutter: false
flutter_analyze:
run: melos exec --depends-on="graphql" -c 1 -- "flutter format --set-exit-if-changed . && flutter analyze . --fatal-infos"
description: Run dart analyzer in a specific package.
select-package:
- scope: "graphql_flutter"
+ flutter: true
client_analyze:
run: melos exec -c 1 -- "dart format --set-exit-if-changed . && dart analyze . --fatal-infos"
description: Run dart analyzer in a specific package.
select-package:
- scope: "graphql"
+ flutter: false
test:
description: Run tests in a specific package.
- run: melos exec --concurrency=2 -- "dart pub get && dart pub run test"
+ run: melos exec -- "dart pub get && dart pub run test"
select-package:
+ flutter: false
dir-exists:
- "test/"
env:
@@ -35,9 +37,9 @@ scripts:
flutter_test:
description: Run tests in a specific package.
- run: melos exec --depends-on="graphql" --concurrency=2 -- "flutter test"
+ run: melos exec --depends-on="graphql" -- "flutter test"
select-package:
- scope: "graphql_flutter"
+ flutter: true
dir-exists:
- "test/"
env:
@@ -45,9 +47,9 @@ scripts:
client_test:
description: Run tests in a specific package.
- run: melos exec --concurrency=2 -- "dart pub get && dart pub run test"
+ run: melos exec -- "dart pub get && dart pub run test"
select-package:
- scope: "graphql"
+ flutter: false
dir-exists:
- "test/"
env:
@@ -55,9 +57,9 @@ scripts:
flutter_test_coverage:
description: Run tests in a specific package.
- run: melos exec --depends-on="graphql" --concurrency=2 -- "flutter test --coverage"
+ run: melos exec --depends-on="graphql" -- "flutter test --coverage"
select-package:
- scope: "graphql_flutter"
+ flutter: true
dir-exists:
- "test/"
env:
@@ -65,12 +67,16 @@ scripts:
client_test_coverage:
description: Run tests in a specific package.
- run: melos exec --concurrency=2 -- "dart run test --coverage="coverage" && dart run coverage:format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.dart_tool/package_config.json --report-on=lib"
+ run: melos exec -- "dart run test --coverage="coverage" && dart run coverage:format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.dart_tool/package_config.json --report-on=lib"
select-package:
- scope: "graphql"
+ flutter: false
dir-exists:
- "test/"
env:
MELOS_TEST: true
format: dart format -o write .
+
+command:
+ bootstrap:
+ usePubspecOverrides: true

MODIFY
packages/graphql/test/websocket_test.dart
packages/graphql/test/websocket_test.dart
@@ -9,7 +9,6 @@ import 'package:gql/language.dart';
import 'package:graphql/client.dart';
import './helpers.dart';
-import './mock_server/ws_echo_server.dart';
import 'mock_server/ws_echo_server.dart';
SocketClient getTestClient({

DELETE
packages/graphql_flutter/example/test/widget_test.dart
-// This is a basic Flutter widget test.
-// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
-// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
-// find child widgets in the widget tree, read text, and verify that the values of widget properties
-// are correct.
-
-// import 'package:flutter/material.dart';
-// import 'package:flutter_test/flutter_test.dart';
-
-void main() {
- // TODO: write tests
-}

feat: Refactor GH actions