ci: update contributing guide & automatically label issues that need … #580
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: unit_tests | |
on: | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: read-all | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
detect_changed_packages: | |
runs-on: ubuntu-latest | |
outputs: | |
packages: ${{ steps.filter.outputs.changed_packages }} | |
has_changes: ${{ steps.filter.outputs.changed_packages != '[]' }} | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/changes | |
id: filter | |
unit_tests: | |
name: "Run unit tests" | |
runs-on: ubuntu-latest | |
needs: detect_changed_packages | |
if: needs.detect_changed_packages.outputs.has_changes == 'true' | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{ fromJson(needs.detect_changed_packages.outputs.packages) }} | |
target: ["html", "io"] | |
steps: | |
- uses: actions/[email protected] | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- uses: bluefireteam/melos-action@v3 | |
with: | |
melos-version: "3.0.1" | |
- name: Run unit tests on Chrome | |
if: matrix.target == 'html' | |
run: | | |
melos exec \ | |
--scope=${{ matrix.package }}* \ | |
--dir-exists="test" \ | |
--fail-fast -- "flutter test --platform chrome" | |
- name: Run unit tests | |
if: matrix.target == 'io' | |
run: | | |
melos exec \ | |
--scope=${{ matrix.package }}* \ | |
--dir-exists="test" \ | |
--fail-fast -- "flutter test" |