|
| 1 | +name: Dart CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'master' |
| 7 | + - 'test_consume_*' |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - '*' |
| 11 | + |
| 12 | +jobs: |
| 13 | + validate: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + sdk: [ 2.7.2, stable, dev ] |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - uses: dart-lang/[email protected] |
| 22 | + with: |
| 23 | + sdk: ${{ matrix.sdk }} |
| 24 | + |
| 25 | + - name: Print Dart SDK version |
| 26 | + run: dart --version |
| 27 | + |
| 28 | + - id: install |
| 29 | + name: Install dependencies |
| 30 | + run: pub get --no-precompile |
| 31 | + |
| 32 | + - name: Validate dependencies |
| 33 | + run: pub run dependency_validator -i coverage,build_runner,build_test,build_web_compilers,meta,pedantic |
| 34 | + if: always() && steps.install.outcome == 'success' |
| 35 | + |
| 36 | + - name: Analyze project source |
| 37 | + run: if [ ${{ matrix.sdk }} = '2.7.2' ]; then pub global activate tuneup && tuneup check --ignore-infos; else dart analyze; fi |
| 38 | + if: always() && steps.install.outcome == 'success' |
| 39 | + |
| 40 | + test_ddc: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + sdk: [ 2.7.2, stable, dev ] |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - uses: dart-lang/[email protected] |
| 49 | + with: |
| 50 | + sdk: ${{ matrix.sdk }} |
| 51 | + |
| 52 | + - name: Print Dart SDK version |
| 53 | + run: dart --version |
| 54 | + |
| 55 | + - id: install |
| 56 | + name: Install dependencies |
| 57 | + run: pub get --no-precompile |
| 58 | + |
| 59 | + - name: Run tests (DDC) |
| 60 | + run: pub run build_runner test -- --file-reporter json:reports/${{ matrix.sdk }}/ddc/test-results.json |
| 61 | + if: always() && steps.install.outcome == 'success' |
| 62 | + |
| 63 | + - name: Upload Unit Test Results |
| 64 | + uses: actions/upload-artifact@v2 |
| 65 | + if: ${{ steps.install.outcome == 'success' && (success() || failure()) }} # run this step even if previous step failed, but not if it was skipped |
| 66 | + with: |
| 67 | + name: ddc-test-results@${{ matrix.sdk }} |
| 68 | + path: reports/${{ matrix.sdk }}/ddc/test-results.json |
| 69 | + |
| 70 | + - name: Report Unit Test Results |
| 71 | + uses: dorny/test-reporter@v1 |
| 72 | + if: ${{ always() && steps.install.outcome == 'success' }} |
| 73 | + with: |
| 74 | + name: Unit Test Results (ddc - ${{ matrix.sdk }}) |
| 75 | + path: 'reports/${{ matrix.sdk }}/ddc/test-results.json' |
| 76 | + reporter: dart-json |
| 77 | + |
| 78 | + test_dart2js: |
| 79 | + runs-on: ubuntu-latest |
| 80 | + strategy: |
| 81 | + fail-fast: false |
| 82 | + matrix: |
| 83 | + sdk: [ 2.7.2, stable, dev ] |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v2 |
| 86 | + - uses: dart-lang/[email protected] |
| 87 | + with: |
| 88 | + sdk: ${{ matrix.sdk }} |
| 89 | + |
| 90 | + - name: Print Dart SDK version |
| 91 | + run: dart --version |
| 92 | + |
| 93 | + - id: install |
| 94 | + name: Install dependencies |
| 95 | + run: pub get --no-precompile |
| 96 | + |
| 97 | + - name: Run tests (dart2js) |
| 98 | + run: pub run build_runner test -r -- --file-reporter json:reports/${{ matrix.sdk }}/dart2js/test-results.json |
| 99 | + if: always() && steps.install.outcome == 'success' |
| 100 | + |
| 101 | + - name: Upload Unit Test Results |
| 102 | + uses: actions/upload-artifact@v2 |
| 103 | + if: ${{ steps.install.outcome == 'success' && (success() || failure()) }} # run this step even if previous step failed, but not if it was skipped |
| 104 | + with: |
| 105 | + name: dart2js-test-results@${{ matrix.sdk }} |
| 106 | + path: reports/${{ matrix.sdk }}/dart2js/test-results.json |
| 107 | + |
| 108 | + - name: Report Unit Test Results |
| 109 | + uses: dorny/test-reporter@v1 |
| 110 | + if: ${{ always() && steps.install.outcome == 'success' }} |
| 111 | + with: |
| 112 | + name: Unit Test Results (dart2js - ${{ matrix.sdk }}) |
| 113 | + path: 'reports/${{ matrix.sdk }}/dart2js/test-results.json' |
| 114 | + reporter: dart-json |
0 commit comments