From fe65da48bfff44efd570405b911996fb9997b108 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Wed, 20 Jan 2021 13:30:01 +0100 Subject: [PATCH 1/3] Migrate to GitHub Actions --- .github/workflows/test-package.yml | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 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..5764265 --- /dev/null +++ b/.github/workflows/test-package.yml @@ -0,0 +1,61 @@ +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 and 2.1.0. + analyze: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sdk: [dev, 2.1.0] + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v0.3 + 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 tests on a matrix consisting of two dimensions: + # 1. OS: ubuntu-latest, (macos-latest, windows-latest) + # 2. release: dev, 2.1.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, 2.1.0] + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v0.3 + with: + sdk: ${{ 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' From fcb71568d407d4c6ce155ca7d94e2f6799977f58 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Wed, 20 Jan 2021 13:30:42 +0100 Subject: [PATCH 2/3] Delete .travis.yml --- .travis.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d164a30..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: dart - -dart: - - 2.1.0 - - dev - -dart_task: - - test - - dartanalyzer: --fatal-infos --fatal-warnings . - -# Only run one instance of the formatter and the analyzer, rather than running -# them against each Dart version. -matrix: - include: - - dart: dev - dart_task: dartfmt - -# Only building master means that we don't run two builds for each pull request. -branches: - only: [master] - -cache: - directories: - - $HOME/.pub-cache From ae1c0b1201b79b82380b292581497e9894a4473b Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Wed, 20 Jan 2021 13:37:56 +0100 Subject: [PATCH 3/3] Fix tests on the 2.1.0 legacy SDK Note: this change removes analysis on 2.1.0. --- .github/workflows/test-package.yml | 32 ++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 5764265..07e2dbf 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -14,13 +14,13 @@ env: jobs: # Check code formatting and static analysis on a single OS (linux) - # against Dart dev and 2.1.0. + # against Dart dev. analyze: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - sdk: [dev, 2.1.0] + sdk: [dev] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v0.3 @@ -38,7 +38,7 @@ jobs: # Run tests on a matrix consisting of two dimensions: # 1. OS: ubuntu-latest, (macos-latest, windows-latest) - # 2. release: dev, 2.1.0 + # 2. release: dev test: needs: analyze runs-on: ${{ matrix.os }} @@ -47,7 +47,7 @@ jobs: matrix: # Add macos-latest and/or windows-latest if relevant for this package. os: [ubuntu-latest] - sdk: [dev, 2.1.0] + sdk: [dev] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v0.3 @@ -59,3 +59,27 @@ jobs: - name: Run VM tests run: dart test --platform vm if: always() && steps.install.outcome == 'success' + + # Run tests on a legacy SDK on a matrix consisting of two dimensions: + # 1. OS: ubuntu-latest, (macos-latest, windows-latest) + # 2. release: 2.1.0 + test_legacy_sdk: + 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: [2.1.0] + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v0.3 + with: + sdk: ${{ matrix.sdk }} + - id: install + name: Install dependencies + run: pub get + - name: Run VM tests + run: pub run test --platform vm + if: always() && steps.install.outcome == 'success'