Skip to content

Commit

Permalink
build: add workflow for auto publish, format test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Chen <[email protected]>
  • Loading branch information
Harry-Chen committed Jan 20, 2024
1 parent e4bc337 commit e4b46fb
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 32 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Publish to pub.dev

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
64 changes: 32 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
name: Test

on:
push:
pull_request:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
sdk: [stable, beta]
test:
runs-on: ubuntu-latest
if: '!contains(github.event.head_commit.message, "ci skip")'
strategy:
matrix:
sdk: [stable, beta]

steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze
- run: dart test
- run: dart doc
- name: Upload generated dartdoc
uses: actions/upload-artifact@v4
with:
name: docs-${{ matrix.sdk }}
path: doc/
- name: Evaluate score with pana
run: |
dart pub global activate pana
dart pub global run pana .
# - name: Run example code
# run: |
# cd example
# dart pub get
# dart run lib/main.dart
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze
- run: dart test
- run: dart doc
- name: Upload generated dartdoc
uses: actions/upload-artifact@v4
with:
name: docs-${{ matrix.sdk }}
path: doc/
- name: Evaluate score with pana
run: |
dart pub global activate pana
dart pub global run pana .
# - name: Run example code
# run: |
# cd example
# dart pub get
# dart run lib/main.dart

0 comments on commit e4b46fb

Please sign in to comment.