Skip to content

Commit

Permalink
Update ci.yml (#109)
Browse files Browse the repository at this point in the history
Use latest CI setup script
Fix directive ordering
  • Loading branch information
kevmoo committed Apr 23, 2021
1 parent 7d807ab commit 9e1818e
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 45 deletions.
71 changes: 37 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
name: ci

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# “At 00:00 (UTC) on Sunday.”
- cron: '0 0 * * 0'

jobs:
analyze_format:
runs-on: ubuntu-latest
steps:
- uses: cedx/setup-dart@v2
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2
- cron: "0 0 * * 0"

- run: pub get
env:
PUB_ENVIRONMENT: bot.github

- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze --fatal-infos .
test_web:
jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev and stable.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: cedx/setup-dart@v2
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1.0
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

- run: pub get
- run: pub run test -p chrome
test_vm:
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
os: [ubuntu-latest]
sdk: [2.12.0, dev]
steps:
- uses: cedx/setup-dart@v2
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2

- run: pub get
- run: pub run test -p vm
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1.0
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: dart test --platform vm,chrome
3 changes: 1 addition & 2 deletions test/browser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// BSD-style license that can be found in the LICENSE file.

@TestOn('browser')

import 'dart:html';

import 'package:test/test.dart';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';

void main() {
group('new Context()', () {
Expand Down
3 changes: 1 addition & 2 deletions test/path_map_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// 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';

import 'package:path/path.dart';
import 'package:test/test.dart';

void main() {
group('considers equal', () {
Expand Down
3 changes: 1 addition & 2 deletions test/path_set_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// 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';

import 'package:path/path.dart';
import 'package:test/test.dart';

void main() {
group('considers equal', () {
Expand Down
2 changes: 1 addition & 1 deletion test/path_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// 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';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';

void main() {
group('path.Style', () {
Expand Down
2 changes: 1 addition & 1 deletion test/posix_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// 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';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';

import 'utils.dart';

Expand Down
2 changes: 1 addition & 1 deletion test/url_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// 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';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';

import 'utils.dart';

Expand Down
2 changes: 1 addition & 1 deletion test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// 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';
import 'package:path/path.dart' as p;
import 'package:test/test.dart';

/// A matcher for a closure that throws a [p.PathException].
final throwsPathException = throwsA(const TypeMatcher<p.PathException>());
Expand Down
2 changes: 1 addition & 1 deletion test/windows_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// 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';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';

import 'utils.dart';

Expand Down

0 comments on commit 9e1818e

Please sign in to comment.