Merge pull request #423 from Workiva/release_react-dart_7.3.1 #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Dart CI | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'test_consume_*' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| # Run as a separate job outside the Dart SDK matrix below, | |
| # since we can only emit a single SBOM. | |
| build: | |
| uses: Workiva/gha-dart-oss/.github/workflows/build.yaml@v0.1.11 | |
| checks: | |
| uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.11 | |
| with: | |
| additional-checks: | | |
| no_entrypoint_imports | |
| # Run Dart 3 analysis as a separate job outside checks above in order to pre-run the | |
| # Dart-2-only file removal script. Consolidate this job with checks above once checks.yaml | |
| # supports a pre-run option or we upgrade to Dart 3 and remove the files. | |
| stable-analyze: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - name: Print Dart SDK version | |
| run: dart --version | |
| - run: dart pub get | |
| - name: Delete Dart-2-only files when running on Dart 3 | |
| run: ./tool/delete_dart_2_only_files.sh | |
| - name: Analyze project source | |
| run: dart analyze | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| react: [17, 18] | |
| sdk: [2.19.6, stable] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: setup-dart | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - name: Print Dart SDK version | |
| run: dart --version | |
| - name: Delete Dart-2-only files when running on Dart 3 | |
| run: | | |
| DART_VERSION="${{ steps.setup-dart.outputs.dart-version }}" | |
| if [[ "$DART_VERSION" =~ ^3 ]]; then | |
| ./tool/delete_dart_2_only_files.sh | |
| fi | |
| - name: Switch to React 17 Test HTML | |
| if: ${{ matrix.react == 17 }} | |
| run: | | |
| mv test/templates/html_template.html test/templates/html_template-old.html | |
| mv test/templates/html_template-react17.html test/templates/html_template.html | |
| - id: install | |
| name: Install dependencies | |
| run: dart pub get | |
| - name: Run tests (DDC) | |
| run: | | |
| dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc --preset=react${{ matrix.react }} | |
| if: always() && steps.install.outcome == 'success' | |
| timeout-minutes: 8 | |
| - name: Run tests (dart2js) | |
| run: | | |
| dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js --preset=react${{ matrix.react }} | |
| if: always() && steps.install.outcome == 'success' | |
| timeout-minutes: 8 | |
| testing-and-checks-complete: | |
| name: Testing and Checks Completed | |
| needs: [ build, checks, test ] | |
| if: ${{ !cancelled() && github.event_name == 'pull_request' || github.ref_type == 'tag' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| if [ "${{ needs.checks.result }}" == "failure" ]; then | |
| echo "Some checks have failed. Please fix the issues and try again." | |
| exit 1 | |
| fi | |
| echo 'All Testing and checks have completed.' |