From c164f1c9d4e0444cc3824ff9709451a41b852488 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Mon, 21 Dec 2020 14:24:52 +0100 Subject: [PATCH 1/5] Migrate to GitHub Actions --- .github/workflows/test-package.yml | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/test-package.yml diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml new file mode 100644 index 0000000..5f0f70b --- /dev/null +++ b/.github/workflows/test-package.yml @@ -0,0 +1,64 @@ +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] + 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 + 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 + 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] + 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: Run VM tests + run: dart test --platform vm + if: always() && steps.install.outcome == 'success' + - name: Run Chrome tests + run: dart test --platform chrome + if: always() && steps.install.outcome == 'success' From 88b08872bb753dcef6a2395b389ebbe5c7a15aa0 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Mon, 21 Dec 2020 14:25:10 +0100 Subject: [PATCH 2/5] Delete .travis.yml --- .travis.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cb4fbf9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: dart - -dart: -- dev - -jobs: - include: - - stage: analyze_and_format - name: "Analyze lib/ (no experiment flag)" - os: linux - script: dartanalyzer --fatal-warnings --fatal-infos lib/ - - stage: analyze_and_format - name: "Analyze (with experiment flag)" - os: linux - script: dartanalyzer --enable-experiment=non-nullable --fatal-warnings --fatal-infos . - - stage: analyze_and_format - name: "Format" - os: linux - script: dartfmt -n --set-exit-if-changed . - - stage: test - name: "Vm Tests" - os: linux - script: pub run --enable-experiment=non-nullable test -p vm - - stage: test - name: "Web Tests" - os: linux - script: pub run --enable-experiment=non-nullable test -p chrome - -branches: - only: [master] - -cache: - directories: - - $HOME/.pub-cache From f21fafe8160d9919d4b7d7854fb59763896c57c8 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Mon, 21 Dec 2020 14:29:57 +0100 Subject: [PATCH 3/5] Replace Travis badge --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1adaeea..119c113 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![pub package](https://img.shields.io/pub/v/characters.svg)](https://pub.dev/packages/characters) -[![Build Status](https://travis-ci.org/dart-lang/characters.svg?branch=master)](https://travis-ci.org/dart-lang/characters) - +[![Build Status](https://github.com/dart-lang/characters/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/characters/actions?query=workflow%3A"Dart+CI") [`Characters`][Characters] are strings viewed as sequences of **user-perceived character**s, From 7b875677a125da370d539d9c2b93f9f88b1348bf Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Mon, 21 Dec 2020 16:55:24 +0100 Subject: [PATCH 4/5] Analyze with `--fatal-infos` --- .github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 5f0f70b..e55702c 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -33,7 +33,7 @@ jobs: run: dart format --output=none --set-exit-if-changed . if: always() && steps.install.outcome == 'success' - name: Analyze code - run: dart analyze + run: dart analyze --fatal-infos if: always() && steps.install.outcome == 'success' # Run tests on a matrix consisting of two dimensions: From c4620d9e6e0f9bae6bea7db98ebf91d597d0d39d Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Tue, 12 Jan 2021 18:03:26 +0100 Subject: [PATCH 5/5] Add branch:master filter to badge link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 119c113..9d37e21 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![pub package](https://img.shields.io/pub/v/characters.svg)](https://pub.dev/packages/characters) -[![Build Status](https://github.com/dart-lang/characters/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/characters/actions?query=workflow%3A"Dart+CI") +[![Build Status](https://github.com/dart-lang/characters/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/characters/actions?query=workflow%3A"Dart+CI"+branch%3Amaster) [`Characters`][Characters] are strings viewed as sequences of **user-perceived character**s,