From 707d953cbd0e146ac0796bb917fefe22fe9280d7 Mon Sep 17 00:00:00 2001 From: Jacob MacDonald Date: Wed, 21 Jul 2021 14:30:10 -0700 Subject: [PATCH 1/2] add a dart test test --- .github/workflows/dart.yml | 30 ++++++++++++++++++++++++++++++ .gitignore | 3 +++ example/pubspec.yaml | 6 ++++++ example/test/example_test.dart | 11 +++++++++++ 4 files changed, 50 insertions(+) create mode 100644 .gitignore create mode 100644 example/pubspec.yaml create mode 100644 example/test/example_test.dart diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 9692b91..d98375b 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -27,6 +27,16 @@ jobs: run: | echo "main() { print('hello world'); }" > hello.dart dart hello.dart + + - id: dart_pub_upgrade + name: Dart pub upgrade + working-directory: example + run: dart pub upgrade + + - name: Dart test + if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" + working-directory: example + run: dart test test_raw: runs-on: ${{ matrix.os }} @@ -49,6 +59,16 @@ jobs: run: | echo "main() { print('hello world'); }" > hello.dart dart hello.dart + + - id: dart_pub_upgrade + name: Dart pub upgrade + working-directory: example + run: dart pub upgrade + + - name: Dart test + if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" + working-directory: example + run: dart test test_arch: runs-on: windows-latest @@ -67,6 +87,16 @@ jobs: run: | echo "main() { print('hello world'); }" > hello.dart dart hello.dart + + - id: dart_pub_upgrade + name: Dart pub upgrade + working-directory: example + run: dart pub upgrade + + - name: Dart test + if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" + working-directory: example + run: dart test test_pub: runs-on: ${{ matrix.os }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb25bcf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +example/.packages +example/pubspec.lock +example/.dart_tool/ diff --git a/example/pubspec.yaml b/example/pubspec.yaml new file mode 100644 index 0000000..0edb667 --- /dev/null +++ b/example/pubspec.yaml @@ -0,0 +1,6 @@ +name: example +publish_to: none +environment: + sdk: '>=2.12.0 <3.0.0' +dev_dependencies: + test: any diff --git a/example/test/example_test.dart b/example/test/example_test.dart new file mode 100644 index 0000000..ef3c3e7 --- /dev/null +++ b/example/test/example_test.dart @@ -0,0 +1,11 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:test/test.dart'; + +void main() { + test('true is true', () { + expect(true, isTrue); + }); +} From 04521892939abb6ba9522273e6df7477b8e47bfb Mon Sep 17 00:00:00 2001 From: Jacob MacDonald Date: Wed, 21 Jul 2021 14:35:37 -0700 Subject: [PATCH 2/2] separate things out and give it its own test matrix --- .github/workflows/dart.yml | 55 +++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index d98375b..27c5fe7 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -27,16 +27,6 @@ jobs: run: | echo "main() { print('hello world'); }" > hello.dart dart hello.dart - - - id: dart_pub_upgrade - name: Dart pub upgrade - working-directory: example - run: dart pub upgrade - - - name: Dart test - if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" - working-directory: example - run: dart test test_raw: runs-on: ${{ matrix.os }} @@ -59,16 +49,6 @@ jobs: run: | echo "main() { print('hello world'); }" > hello.dart dart hello.dart - - - id: dart_pub_upgrade - name: Dart pub upgrade - working-directory: example - run: dart pub upgrade - - - name: Dart test - if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" - working-directory: example - run: dart test test_arch: runs-on: windows-latest @@ -87,16 +67,6 @@ jobs: run: | echo "main() { print('hello world'); }" > hello.dart dart hello.dart - - - id: dart_pub_upgrade - name: Dart pub upgrade - working-directory: example - run: dart pub upgrade - - - name: Dart test - if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" - working-directory: example - run: dart test test_pub: runs-on: ${{ matrix.os }} @@ -119,3 +89,28 @@ jobs: stagehand console-simple dart pub get dart run + + test_test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + # Test latest stable, beta, dev channels + sdk: [stable, beta, dev] + flavor: [release] + steps: + - uses: actions/checkout@v2 + - uses: ./ + with: + sdk: ${{ matrix.sdk }} + + - id: dart_pub_upgrade + name: Dart pub upgrade + working-directory: example + run: dart pub upgrade + + - name: Dart test + if: "always() && steps.dart_pub_upgrade.conclusion == 'success'" + working-directory: example + run: dart test