Skip to content

Fix Dart 3 analysis

Fix Dart 3 analysis #4

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

reusable workflows should be referenced at the top-level `jobs.*.uses' key, not within steps
on:
push:
branches:
- 'master'
- 'test_consume_*'
pull_request:
branches:
- '**'
jobs:
checks:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [ 2.19.6, stable ]
steps:
- name: Delete Dart-2-only files when running on Dart 3
if: ${{ matrix.sdk != '2.19.6' }}
run: |
./tool/delete_dart_2_only_files.sh
- uses: Workiva/gha-dart-oss/.github/workflows/[email protected]
with:
additional-checks: |
no_entrypoint_imports
sdk: ${{ matrix.sdk }}
format-check: ${{ matrix.sdk == '2.19.6' }}
# 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/[email protected]
with:
sdk: 2.19.6 # This version doesn't matter so long as it resolves.
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
react: [ 17, 18 ]
sdk: [ 2.19.6, stable ]
steps:
- uses: actions/checkout@v2
- 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