diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 00000000..6e7e79d4 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,37 @@ +name: Android Release + +# 1 +on: [push, pull_request] + +# 4 +jobs: + # 5 + build: + # 6 + runs-on: ubuntu-latest + + # 7 + steps: + # 8 + - uses: actions/checkout@v3 + # 9 + - uses: actions/setup-java@v3 + with: + distribution: "zulu" + java-version: "12.x" + # 10 + - uses: subosito/flutter-action@v2 + with: + # 11 + flutter-version: "3.0.0" + channel: "stable" + # 12 + - name: Get dependencies + run: flutter pub Get + + - name: Run Code Metrics + run: flutter pub run dart_code_metrics:metrics --reporter=github lib + + # Runs a set of commands using the runners shell + - name: Start release build + run: flutter build appbundle diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 00000000..72788038 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,22 @@ +analyzer: + plugins: + - dart_code_metrics + +dart_code_metrics: + anti-patterns: + - long-method + - long-parameter-list + metrics: + cyclomatic-complexity: 20 + lines-of-executable-code: 50 + number-of-parameters: 4 + maximum-nesting-level: 5 + metrics-exclude: + - test/** + rules: + - newline-before-return + - no-boolean-literal-compare + - no-empty-block + - prefer-trailing-comma + - prefer-conditional-expressions + - no-equal-then-else diff --git a/pubspec.yaml b/pubspec.yaml index 5bc2b5fc..bc447661 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,6 +25,7 @@ dependencies: carousel_slider: ^4.2.1 dev_dependencies: + dart_code_metrics: ^5.7.6 flutter_test: sdk: flutter flutter: