Skip to content

Commit

Permalink
feat: Refactor GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
budde377 committed Aug 13, 2022
1 parent 7a84abb commit 315d85c
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 147 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: graphql Dart Code sanity check
name: Build

on:
push:
Expand All @@ -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:
channel: 'stable'
channel: ${{matrix.channel}}
- name: Install dependencies
run: make dep
- name: Code formatting check
run: make ci_fmt_client
run: make ci_fmt_client
- name: Code formatting check (flutter)
run: make ci_fmt_flutter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: graphql Code coverage
name: Codecoverage

on:
push:
Expand All @@ -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
18 changes: 0 additions & 18 deletions .github/workflows/graphql_flutter_build.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/graphql_flutter_codcoverage.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/graphql_tests.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/packages_build.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/packages_tests.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: graphql Release Package
name: Release (dart)

on:
release:
Expand All @@ -8,8 +8,8 @@ on:
push:
workflow_run:
workflows:
- "graphql Test case"
- "graphql Dart Code sanity check"
- "Test"
- "Build"
branches: [ main ]
types:
- completed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: graphql-flutter Release Package
name: Release (flutter)

on:
release:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: publish packages to pub.dev
name: Release (packages)

on:
release:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: graphql_flutter tests case
name: Test

on:
push:
Expand All @@ -14,8 +14,9 @@ jobs:
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '2.10.5'
- name: Install dependencies
run: make dep
- name: Tests
- name: Tests (dart)
run: make ci_check_client
- name: Tests (flutter)
run: make ci_check_flutter
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
.flutter-plugins
pubspec.lock
pubspec_overrides.yaml

# Coverage
coverage.json
Expand Down
30 changes: 18 additions & 12 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,72 @@ 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:
MELOS_TEST: true

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:
MELOS_TEST: true

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:
MELOS_TEST: true

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:
MELOS_TEST: true

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 .
format: dart format -o write .

command:
bootstrap:
usePubspecOverrides: true
1 change: 0 additions & 1 deletion packages/graphql/test/websocket_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
12 changes: 0 additions & 12 deletions packages/graphql_flutter/example/test/widget_test.dart

This file was deleted.

0 comments on commit 315d85c

Please sign in to comment.