name: Continuous Integration on: # Direct pushes are only validated on master (post-merge); everything else # is covered by the pull_request trigger, avoiding duplicate runs for # same-repo PR branches. push: branches: [ master, ] paths: - '**.dart' - 'pubspec.yaml' pull_request: paths: - '**/*.dart' - 'pubspec.yaml' - '.github/actions/flutter-common/action.yml' - '.github/workflows/ci.yml' workflow_call: workflow_dispatch: permissions: contents: read concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: test: name: Run tests (shard ${{ matrix.shard }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: shard: [0, 1, 2, 3, 4, 5] env: TZ: Europe/Berlin steps: - uses: actions/checkout@v7 with: persist-credentials: false - name: Common flutter setup uses: ./.github/actions/flutter-common - name: Install system dependencies run: sudo apt install libsqlite3-dev lcov --no-install-recommends # Removing some folders from the coverage since these files are not really # part of the app code and just get in the way of the report - name: Test app run: | flutter test --coverage --total-shards 6 --shard-index ${{ matrix.shard }} lcov --remove coverage/lcov.info 'lib/l10n/generated/*' 'lib/theme/*' -o coverage/lcov.info - name: Upload coverage to Coveralls uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} flag-name: shard-${{ matrix.shard }} parallel: true finish: name: Finish coverage needs: test runs-on: ubuntu-latest if: ${{ always() }} steps: - name: Close parallel Coveralls build uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true