Migrate to GitHub Actions (dart-lang/timing#15)
* Migrate to GitHub Actions
* Delete .travis.yml
* Replace Travis badge
* Use legacy commands to support old SDKs
diff --git a/pkgs/timing/.github/workflows/test-package.yml b/pkgs/timing/.github/workflows/test-package.yml
new file mode 100644
index 0000000..b04d6e2
--- /dev/null
+++ b/pkgs/timing/.github/workflows/test-package.yml
@@ -0,0 +1,68 @@
+name: Dart CI
+
+on:
+ # Run on PRs and pushes to the default branch.
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ schedule:
+ - cron: "0 0 * * 0"
+
+env:
+ PUB_ENVIRONMENT: bot.github
+
+jobs:
+ # Check code formatting and static analysis on a single OS (linux)
+ # against Dart dev.
+ analyze:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sdk: [dev]
+ version: [latest]
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dart-lang/setup-dart@v0.1
+ with:
+ channel: ${{ 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 tests on a matrix consisting of two dimensions:
+ # 1. OS: ubuntu-latest, (macos-latest, windows-latest)
+ # 2. release channel: dev, 2.2.0
+ test:
+ needs: analyze
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # Add macos-latest and/or windows-latest if relevant for this package.
+ os: [ubuntu-latest]
+ sdk: [dev]
+ version: [latest]
+ include:
+ - os: ubuntu-latest
+ sdk: stable
+ version: 2.2.0
+ steps:
+ - uses: actions/checkout@v2
+ - uses: cedx/setup-dart@v2 # TODO(dart-lang/setup-dart#3): use the official setup-dart action
+ with:
+ release-channel: ${{ matrix.sdk }}
+ version: ${{ matrix.version }}
+ - id: install
+ name: Install dependencies
+ run: pub get
+ - name: Run VM tests
+ run: pub run test --platform vm
+ if: always() && steps.install.outcome == 'success'
diff --git a/pkgs/timing/.travis.yml b/pkgs/timing/.travis.yml
deleted file mode 100644
index df41489..0000000
--- a/pkgs/timing/.travis.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-language: dart
-
-dart:
- - 2.2.0
- - dev
-
-dart_task:
-- dartanalyzer: --fatal-infos .
-- test
-
-matrix:
- include:
- # Only validate formatting using the dev release
- - dart: dev
- dart_task: dartfmt
-
-branches:
- only:
- - master
-
-cache:
- directories:
- - $HOME/.pub-cache
diff --git a/pkgs/timing/README.md b/pkgs/timing/README.md
index 400bc4b..d34648d 100644
--- a/pkgs/timing/README.md
+++ b/pkgs/timing/README.md
@@ -1,4 +1,4 @@
-# [](https://travis-ci.org/dart-lang/timing)
+# [](https://github.com/dart-lang/timing/actions?query=workflow%3A"Dart+CI"+branch%3Amaster)
Timing is a simple package for tracking performance of both async and sync actions
@@ -19,4 +19,4 @@
```bash
pub run build_runner build
-```
\ No newline at end of file
+```