|
1 | | -name: CI |
| 1 | +name: Dart CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
10 | 10 | - '**' |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - checks: |
14 | | - strategy: |
15 | | - matrix: |
16 | | - sdk: [ 2.19.6, stable ] |
17 | | - uses: ./.github/workflows/test.yml |
18 | | - with: |
19 | | - sdk: ${{ matrix.sdk }} |
20 | | - |
21 | 13 | # Run as a separate job outside the Dart SDK matrix below, |
22 | 14 | # since we can only emit a single SBOM. |
23 | 15 | build: |
24 | 16 | uses: Workiva/gha-dart-oss/.github/workflows/[email protected] |
25 | 17 | with: |
26 | | - sdk: 2.19.6 # This version doesn't matter so long as it resolves. |
| 18 | + sdk: 2.19.6 # This version doesn't matter so long as it resolves |
| 19 | + |
| 20 | + checks: |
| 21 | + uses: Workiva/gha-dart-oss/.github/workflows/[email protected] |
| 22 | + with: |
| 23 | + additional-checks: | |
| 24 | + no_entrypoint_imports |
| 25 | +
|
| 26 | + stable-analyze: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v2 |
| 30 | + - uses: dart-lang/setup-dart@v1 |
| 31 | + with: |
| 32 | + sdk: stable |
| 33 | + |
| 34 | + - name: Print Dart SDK version |
| 35 | + run: dart --version |
| 36 | + |
| 37 | + - name: Delete Dart-2-only files when running on Dart 3 |
| 38 | + run: ./tool/delete_dart_2_only_files.sh |
| 39 | + |
| 40 | + - name: Analyze project source |
| 41 | + run: dart analyze |
| 42 | + |
| 43 | + test: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + strategy: |
| 46 | + fail-fast: false |
| 47 | + matrix: |
| 48 | + react: [17, 18] |
| 49 | + sdk: [2.19.6, stable] |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v2 |
| 52 | + - id: setup-dart |
| 53 | + uses: dart-lang/setup-dart@v1 |
| 54 | + with: |
| 55 | + sdk: ${{ matrix.sdk }} |
| 56 | + |
| 57 | + - name: Print Dart SDK version |
| 58 | + run: dart --version |
| 59 | + |
| 60 | + - name: Delete Dart-2-only files when running on Dart 3 |
| 61 | + run: | |
| 62 | + DART_VERSION="${{ steps.setup-dart.outputs.dart-version }}" |
| 63 | + if [[ "$DART_VERSION" =~ ^3 ]]; then |
| 64 | + ./tool/delete_dart_2_only_files.sh |
| 65 | + fi |
| 66 | +
|
| 67 | + - name: Switch to React 17 Test HTML |
| 68 | + if: ${{ matrix.react == 17 }} |
| 69 | + run: | |
| 70 | + mv test/templates/html_template.html test/templates/html_template-old.html |
| 71 | + mv test/templates/html_template-react17.html test/templates/html_template.html |
| 72 | +
|
| 73 | + - id: install |
| 74 | + name: Install dependencies |
| 75 | + run: dart pub get |
| 76 | + |
| 77 | + - name: Run tests (DDC) |
| 78 | + run: | |
| 79 | + dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc --preset=react${{ matrix.react }} |
| 80 | + if: always() && steps.install.outcome == 'success' |
| 81 | + timeout-minutes: 8 |
| 82 | + |
| 83 | + - name: Run tests (dart2js) |
| 84 | + run: | |
| 85 | + dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js --preset=react${{ matrix.react }} |
| 86 | + if: always() && steps.install.outcome == 'success' |
| 87 | + timeout-minutes: 8 |
0 commit comments