|
12 | 12 | jobs:
|
13 | 13 | # Run as a separate job outside the Dart SDK matrix below,
|
14 | 14 | # since we can only emit a single SBOM.
|
15 |
| - create-sbom-release-asset: |
16 |
| - name: Create SBOM Release Asset |
| 15 | + build: |
| 16 | + uses: Workiva/gha-dart-oss/.github/workflows/[email protected] |
| 17 | + |
| 18 | + checks: |
| 19 | + uses: Workiva/gha-dart-oss/.github/workflows/[email protected] |
| 20 | + with: |
| 21 | + additional-checks: | |
| 22 | + no_entrypoint_imports |
| 23 | +
|
| 24 | + # Run Dart 3 analysis as a separate job outside checks above in order to pre-run the |
| 25 | + # Dart-2-only file removal script. Consolidate this job with checks above once checks.yaml |
| 26 | + # supports a pre-run option or we upgrade to Dart 3 and remove the files. |
| 27 | + stable-analyze: |
17 | 28 | runs-on: ubuntu-latest
|
18 | 29 | steps:
|
19 | 30 | - uses: actions/checkout@v4
|
20 | 31 | - uses: dart-lang/setup-dart@v1
|
21 | 32 | with:
|
22 |
| - sdk: 2.19.6 # This version doesn't matter so long as it resolves. |
| 33 | + sdk: stable |
| 34 | + |
| 35 | + - name: Print Dart SDK version |
| 36 | + run: dart --version |
23 | 37 | - run: dart pub get
|
24 |
| - - name: Publish SBOM to Release Assets |
25 |
| - uses: anchore/sbom-action@v0 |
26 |
| - with: |
27 |
| - path: ./ |
28 |
| - format: cyclonedx-json |
29 | 38 |
|
30 |
| - build: |
| 39 | + - name: Delete Dart-2-only files when running on Dart 3 |
| 40 | + run: ./tool/delete_dart_2_only_files.sh |
| 41 | + |
| 42 | + - name: Analyze project source |
| 43 | + run: dart analyze |
| 44 | + |
| 45 | + test: |
31 | 46 | runs-on: ubuntu-latest
|
32 | 47 | strategy:
|
33 | 48 | fail-fast: false
|
34 | 49 | matrix:
|
35 | 50 | react: [17, 18]
|
36 | 51 | sdk: [2.19.6, stable]
|
37 | 52 | steps:
|
38 |
| - - uses: actions/checkout@v2 |
| 53 | + - uses: actions/checkout@v4 |
39 | 54 | - id: setup-dart
|
40 | 55 | uses: dart-lang/setup-dart@v1
|
41 | 56 | with:
|
|
50 | 65 | if [[ "$DART_VERSION" =~ ^3 ]]; then
|
51 | 66 | ./tool/delete_dart_2_only_files.sh
|
52 | 67 | fi
|
| 68 | +
|
53 | 69 | - name: Switch to React 17 Test HTML
|
54 | 70 | if: ${{ matrix.react == 17 }}
|
55 | 71 | run: |
|
|
60 | 76 | name: Install dependencies
|
61 | 77 | run: dart pub get
|
62 | 78 |
|
63 |
| - - name: Validate dependencies |
64 |
| - run: dart run dependency_validator |
65 |
| - if: always() && steps.install.outcome == 'success' |
66 |
| - |
67 |
| - - name: Verify formatting |
68 |
| - run: dart run dart_dev format --check |
69 |
| - if: ${{ matrix.sdk == '2.19.6' }} |
70 |
| - |
71 |
| - - name: Analyze project source |
72 |
| - run: dart analyze |
73 |
| - if: always() && steps.install.outcome == 'success' |
74 |
| - |
75 | 79 | - name: Run tests (DDC)
|
76 | 80 | run: |
|
77 | 81 | dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc --preset=react${{ matrix.react }}
|
|
83 | 87 | dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js --preset=react${{ matrix.react }}
|
84 | 88 | if: always() && steps.install.outcome == 'success'
|
85 | 89 | timeout-minutes: 8
|
| 90 | + |
| 91 | + testing-and-checks-complete: |
| 92 | + name: Testing and Checks Completed |
| 93 | + needs: [ build, checks, test ] |
| 94 | + if: ${{ !cancelled() && github.event_name == 'pull_request' || github.ref_type == 'tag' }} |
| 95 | + runs-on: ubuntu-latest |
| 96 | + steps: |
| 97 | + - run: | |
| 98 | + if [ "${{ needs.checks.result }}" == "failure" ]; then |
| 99 | + echo "Some checks have failed. Please fix the issues and try again." |
| 100 | + exit 1 |
| 101 | + fi |
| 102 | + echo 'All Testing and checks have completed.' |
0 commit comments