diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/ci.yml similarity index 72% rename from .github/workflows/dart_ci.yml rename to .github/workflows/ci.yml index edc04154..df886764 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/ci.yml @@ -12,22 +12,37 @@ on: jobs: # Run as a separate job outside the Dart SDK matrix below, # since we can only emit a single SBOM. - create-sbom-release-asset: - name: Create SBOM Release Asset + 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: 2.19.6 # This version doesn't matter so long as it resolves. + sdk: stable + + - name: Print Dart SDK version + run: dart --version - run: dart pub get - - name: Publish SBOM to Release Assets - uses: anchore/sbom-action@v0 - with: - path: ./ - format: cyclonedx-json - build: + - 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 @@ -35,7 +50,7 @@ jobs: react: [17, 18] sdk: [2.19.6, stable] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: setup-dart uses: dart-lang/setup-dart@v1 with: @@ -50,6 +65,7 @@ jobs: 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: | @@ -60,18 +76,6 @@ jobs: name: Install dependencies run: dart pub get - - name: Validate dependencies - run: dart run dependency_validator - if: always() && steps.install.outcome == 'success' - - - name: Verify formatting - run: dart run dart_dev format --check - if: ${{ matrix.sdk == '2.19.6' }} - - - name: Analyze project source - run: dart analyze - if: always() && steps.install.outcome == 'success' - - name: Run tests (DDC) run: | dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc --preset=react${{ matrix.react }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..15fd5880 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +name: Publish + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: write + id-token: write + pull-requests: write + +jobs: + publish: + uses: Workiva/gha-dart-oss/.github/workflows/publish.yaml@v0.1.11 diff --git a/CHANGELOG.md b/CHANGELOG.md index f8a8035d..84d69b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 7.3.1 +- Set up gha-dart-oss +- Fix no_entrypoint_imports warnings + ## 7.3.0 - Add new, opt-in React 18 JS files (see [README](https://github.com/Workiva/react-dart#html) for more info) - The preexisting JS files that use React 17 are now deprecated, and will be removed in the next major version, 8.0.0. diff --git a/pubspec.yaml b/pubspec.yaml index dc7f82ed..2e559b47 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dev_dependencies: build_runner: ^2.1.2 build_test: ^2.1.3 build_web_compilers: '>=3.0.0 <5.0.0' - dart_dev: ^4.0.0 + dart_dev: ^4.2.4 dependency_validator: ^3.2.2 glob: ^2.0.0 matcher: ^0.12.11 diff --git a/tool/dart_dev/config.dart b/tool/dart_dev/config.dart index bdacb930..ebbd1bfc 100644 --- a/tool/dart_dev/config.dart +++ b/tool/dart_dev/config.dart @@ -22,4 +22,5 @@ final config = { // Don't format generated mockito files. Glob('test/mockito.mocks.dart'), ], + 'analyze': AnalyzeTool(), };