feat:参照研听的基础工程
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
||||
|
||||
- package-ecosystem: "pub"
|
||||
directory: "example"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
||||
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "android"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "example/android"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
@@ -0,0 +1,34 @@
|
||||
name: Flutter build example
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build_android:
|
||||
name: Build example for Android
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Disable analytics
|
||||
run: flutter config --no-analytics
|
||||
- name: Flutter pub get
|
||||
run: flutter pub get
|
||||
- name: Flutter build appbundle
|
||||
run: |
|
||||
cd example
|
||||
flutter build appbundle --release
|
||||
@@ -0,0 +1,101 @@
|
||||
name: Flutter checks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
check_pub_dependencies:
|
||||
name: Check dependencies
|
||||
timeout-minutes: 10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Disable analytics
|
||||
run: flutter config --no-analytics
|
||||
- name: Flutter pub get
|
||||
run: flutter pub get
|
||||
|
||||
check_formatting:
|
||||
name: Check formatting
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Disable analytics
|
||||
run: flutter config --no-analytics
|
||||
- name: Flutter pub get
|
||||
run: flutter pub get
|
||||
- name: Check Dart formatting
|
||||
run: dart format --line-length 80 --set-exit-if-changed .
|
||||
|
||||
analyze:
|
||||
name: Dart analyze
|
||||
timeout-minutes: 10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Disable analytics
|
||||
run: flutter config --no-analytics
|
||||
- name: Flutter pub get
|
||||
run: flutter pub get
|
||||
- name: Run Dart analyze
|
||||
uses: invertase/github-action-dart-analyzer@v3.0.0
|
||||
|
||||
test:
|
||||
name: Flutter test
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Disable analytics
|
||||
run: flutter config --no-analytics
|
||||
- name: Flutter pub get
|
||||
run: flutter pub get
|
||||
- name: Flutter test
|
||||
run: flutter test
|
||||
|
||||
test_example:
|
||||
name: Flutter test example
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Disable analytics
|
||||
run: flutter config --no-analytics
|
||||
- name: Flutter pub get
|
||||
run: |
|
||||
cd example
|
||||
flutter pub get
|
||||
- name: Flutter test example
|
||||
run: |
|
||||
cd example
|
||||
flutter test
|
||||
@@ -0,0 +1,18 @@
|
||||
name: Pub publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Pub publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Publish
|
||||
uses: k-paxian/dart-package-publisher@v1.6
|
||||
with:
|
||||
credentialJson: ${{ secrets.CREDENTIALS }}
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Pub publish dry run
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
publish-dry-run:
|
||||
name: Pub publish dry run
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Publish dry run
|
||||
uses: k-paxian/dart-package-publisher@v1.6
|
||||
with:
|
||||
credentialJson: 'MockCredentialJson'
|
||||
dryRunOnly: true
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Check pub score
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
check-score:
|
||||
name: Check pub score
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- uses: axel-op/dart-package-analyzer@v3
|
||||
id: workflow
|
||||
with:
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Check score
|
||||
env:
|
||||
TOTAL: ${{ steps.workflow.outputs.total }}
|
||||
TOTAL_MAX: ${{ steps.workflow.outputs.total_max }}
|
||||
run: |
|
||||
MISSING_POINTS=$(( $TOTAL_MAX - $TOTAL ))
|
||||
if (( MISSING_POINTS > 0 ))
|
||||
then
|
||||
echo Score can be improved!
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user