From 69516f461a66ec6184495ddbea17487a7f20bc2a Mon Sep 17 00:00:00 2001 From: shilangyu Date: Sun, 2 Aug 2020 19:26:57 +0200 Subject: [PATCH] Added linter and CI setup --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ analysis_options.yaml | 1 + pubspec.lock | 7 +++++++ pubspec.yaml | 2 +- 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 analysis_options.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e2704ef --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: ci + +on: + push: + tags: + - "v*.*.*" + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-java@v1 + with: + java-version: "12.x" + + - uses: subosito/flutter-action@v1 + with: + channel: "stable" + + - name: Get dependencies + run: flutter pub get + + - name: Run lints + run: flutter analyze + + - name: Run tests + run: flutter test + + - name: Build APKs + run: flutter build apk --split-per-abi + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') && github.repository == 'krawieck/lemmur' + with: + files: | + build/app/outputs/apk/release/*.apk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..d3ee447 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1 @@ +include: package:effective_dart/analysis_options.yaml diff --git a/pubspec.lock b/pubspec.lock index b6489c5..dacbe7b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -64,6 +64,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + effective_dart: + dependency: "direct dev" + description: + name: effective_dart + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.4" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 457dbe0..2b7d01f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - + effective_dart: ^1.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec