New improvements #35
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
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
flutter_version: "3.19.5" | |
java_version: "11.x" | |
jobs: | |
format-and-lint: | |
name: Linting and tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ env.java_version }} | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v1 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Format code | |
run: dart format . --set-exit-if-changed | |
- name: Lint analysis | |
run: flutter analyze --no-pub | |
- name: Run tests | |
run: flutter test --coverage | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v1.2.1 | |
with: | |
file: ./coverage/lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build-android: | |
name: Build android client | |
needs: [format-and-lint] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ env.java_version }} | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v1 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: ./example | |
- name: Build | |
run: flutter build apk | |
working-directory: ./example | |
- run: git diff --exit-code |