-
Notifications
You must be signed in to change notification settings - Fork 58
FED-4063 Set up gha-dart-oss #986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a6f0bbb
Add publish set-up and start gha-dart-oss setup
sydneyjodon-wk dd6ff4a
Update analysis and changelog
sydneyjodon-wk 9396bd3
Update release name to "Unreleased"
sydneyjodon-wk 5515ded
Add Testing and Checks Completed step
sydneyjodon-wk 643ca70
Update runner
sydneyjodon-wk 4f3885d
Update test name
sydneyjodon-wk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Dart CI | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
|
|
@@ -19,22 +19,16 @@ permissions: | |
| 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 | ||
| 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. | ||
| - run: dart pub get | ||
| - name: Publish SBOM to Release Assets | ||
| uses: anchore/sbom-action@v0 | ||
| with: | ||
| path: ./ | ||
| format: cyclonedx-json | ||
|
|
||
| build: | ||
| uses: Workiva/gha-dart-oss/.github/workflows/[email protected] | ||
|
|
||
| checks: | ||
| uses: Workiva/gha-dart-oss/.github/workflows/[email protected] | ||
| with: | ||
| additional-checks: | | ||
| no_entrypoint_imports | ||
|
|
||
| test_and_check_generated_files: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
|
|
@@ -62,15 +56,6 @@ jobs: | |
| ./tool/update_tests_for_dart_3.sh | ||
| fi | ||
|
|
||
| - name: Validate dependencies | ||
| run: dart run dependency_validator | ||
| if: always() && steps.install.outcome == 'success' | ||
|
|
||
| - name: Verify formatting | ||
| run: dart run dart_dev format --check | ||
| # Only run on one sdk version in case there are conflicts | ||
| if: always() && matrix.sdk == '2.19.6' && steps.install.outcome == 'success' | ||
|
|
||
| # Analyze before generated files are created to verify that component boilerplate analysis is "clean" without the need for building | ||
| - name: Analyze example source (pre-build) | ||
| run: | | ||
|
|
@@ -234,3 +219,16 @@ jobs: | |
| run: dart run dart_dev test | ||
| if: always() && steps.install.outcome == 'success' | ||
| timeout-minutes: 8 | ||
|
|
||
| testing-and-checks-complete: | ||
| name: Testing and Checks Completed | ||
| needs: [ build, checks, test_and_check_generated_files, validate_analyzer, analyzer_plugin ] | ||
| 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.' | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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/[email protected] | ||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tl;dr we're good, posting for posterity
At first I thought this wasn't going to work once we switch to Dart 3, since it doesn't have
--force(see here), and this repo currently has warnings when analyzing the files in tools/analyzer_plugin.But, it looks like they fixed that in dart-lang/pub#3630 (somewhere from Dart 3.3.0 to 3.4.0), so we don't have to worry about it!
In 3.4.0+, there's only a warning about
tools/, but I don't think that'll prevent the package from publishing:So we're all good here; just wanted to note that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Yeah I was wondering if that thread was solved in some other way! Thanks for checking!