-
Notifications
You must be signed in to change notification settings - Fork 1
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
initial improvements #1
Draft
jsiedentop
wants to merge
13
commits into
main
Choose a base branch
from
improvements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2546a79
update Readme
jsiedentop 5068c95
add actions
jsiedentop 0940b2f
serialization: avoid null values
jsiedentop 3688138
serialization: avoid null values on generated types
jsiedentop 57b01fc
add tests
jsiedentop df1f9de
add rfc7946.md
jsiedentop 07c7fb4
remove different ci platforms
jsiedentop 97a6339
add validation
jsiedentop b5cc199
add validation to fromJson
jsiedentop e233872
add validation on constructors
jsiedentop 147d6d2
remove dependency json annotation
jsiedentop 9b1ef2f
remove build runner from pipeline
jsiedentop b697434
remove build runner step from publish ci
jsiedentop 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 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,31 @@ | ||
name: Dart pub publish --dry-run, Publishing Preview for PRs | ||
on: | ||
pull_request: | ||
branches: | ||
- releases | ||
jobs: | ||
preview-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: stable | ||
|
||
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
- name: Analyze project source | ||
run: dart analyze | ||
if: always() | ||
|
||
- name: Preview publish package (dry-run) | ||
run: dart pub publish --dry-run |
This file contains 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,49 @@ | ||
name: Publish package to pub.dev | ||
on: | ||
push: | ||
branches: | ||
- releases | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: stable | ||
|
||
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
- name: Analyze project source | ||
run: dart analyze | ||
if: always() | ||
|
||
- name: Setup credentials | ||
env: | ||
OAUTH_ACCESS_TOKEN: ${{ secrets.OAUTH_ACCESS_TOKEN }} | ||
OAUTH_REFRESH_TOKEN: ${{ secrets.OAUTH_REFRESH_TOKEN }} | ||
OAUTH_EXPIRATION: ${{ secrets.OAUTH_EXPIRATION }} | ||
run: | | ||
mkdir -p ~/.pub-cache | ||
cat <<EOF > ~/.pub-cache/credentials.json | ||
{ | ||
"accessToken":"${OAUTH_ACCESS_TOKEN}", | ||
"refreshToken":"${OAUTH_REFRESH_TOKEN}", | ||
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token", | ||
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ], | ||
"expiration": ${OAUTH_EXPIRATION} | ||
} | ||
EOF | ||
|
||
- name: Publish package | ||
run: dart pub publish --force | ||
if: always() |
This file contains 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,39 @@ | ||
name: Dart Unit Tests for PRs | ||
|
||
on: | ||
pull_request: | ||
branches: ["**"] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: stable | ||
|
||
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
- name: Analyze project source | ||
run: dart analyze | ||
if: always() | ||
|
||
- name: Run tests with coverage enabled | ||
run: dart test --coverage=./coverage | ||
if: always() | ||
|
||
- name: Archive raw coverage artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: raw-coverage | ||
path: ./coverage |
This file contains 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,37 @@ | ||
name: Dart Unit Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
sdk: [stable] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
|
||
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
- name: Analyze project source | ||
run: dart analyze | ||
if: always() | ||
|
||
- name: Run tests | ||
run: dart test | ||
if: always() |
This file contains 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,58 @@ | ||
name: Pull Request Code Coverage Reporting | ||
on: | ||
workflow_run: | ||
workflows: ["Dart Unit Tests for PRs"] | ||
types: [completed] | ||
|
||
jobs: | ||
coverage-reporting: | ||
if: > | ||
${{ github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: stable | ||
|
||
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Download raw coverage from tests workflow | ||
uses: dawidd6/[email protected] | ||
with: | ||
workflow: dart-unit-tests-on-pr.yml | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: raw-coverage | ||
path: ./coverage | ||
|
||
- name: Convert to LCOV report | ||
run: | | ||
dart pub global activate coverage | ||
dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage | ||
|
||
- name: Generate HTML coverage report | ||
run: | | ||
sudo apt install lcov | ||
genhtml -o ./coverage/report ./coverage/lcov.info | ||
|
||
- name: Comment on PR with coverage | ||
continue-on-error: true | ||
uses: romeovs/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
lcov-file: ./coverage/lcov.info | ||
|
||
- name: Archive coverage report | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage-report | ||
path: | | ||
./coverage/report | ||
./coverage/lcov.info |
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
Dart