Skip to content

add a "dart test" test #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
example/.packages
example/pubspec.lock
example/.dart_tool/
6 changes: 6 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: example
publish_to: none
environment:
sdk: '>=2.12.0 <3.0.0'
dev_dependencies:
test: any
11 changes: 11 additions & 0 deletions example/test/example_test.dart
Original file line number Diff line number Diff line change
@@ -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);
});
}