|
| 1 | +name: package:collection |
| 2 | + |
| 3 | +on: |
| 4 | + # Run CI on pushes to the main branch, and on PRs against main. |
| 5 | + push: |
| 6 | + branches: [ main ] |
| 7 | + paths: |
| 8 | + - '.github/workflows/collection.yaml' |
| 9 | + - 'pkgs/collection/**' |
| 10 | + pull_request: |
| 11 | + branches: [ main ] |
| 12 | + paths: |
| 13 | + - '.github/workflows/collection.yaml' |
| 14 | + - 'pkgs/collection/**' |
| 15 | + schedule: |
| 16 | + - cron: "0 0 * * 0" |
| 17 | + |
| 18 | +env: |
| 19 | + PUB_ENVIRONMENT: bot.github |
| 20 | + |
| 21 | +defaults: |
| 22 | + run: |
| 23 | + working-directory: pkgs/collection/ |
| 24 | + |
| 25 | +jobs: |
| 26 | + # Check code formatting and static analysis on a single OS (linux) |
| 27 | + # against Dart dev. |
| 28 | + analyze: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + sdk: [dev] |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 |
| 36 | + - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 |
| 37 | + with: |
| 38 | + sdk: ${{ matrix.sdk }} |
| 39 | + - id: install |
| 40 | + name: Install dependencies |
| 41 | + run: dart pub get |
| 42 | + - name: Check formatting |
| 43 | + run: dart format --output=none --set-exit-if-changed . |
| 44 | + if: always() && steps.install.outcome == 'success' |
| 45 | + - name: Analyze code |
| 46 | + run: dart analyze --fatal-infos |
| 47 | + if: always() && steps.install.outcome == 'success' |
| 48 | + |
| 49 | + # Run tests on a matrix consisting of two dimensions: |
| 50 | + # 1. OS: ubuntu-latest, (macos-latest, windows-latest) |
| 51 | + # 2. release channel: dev |
| 52 | + test: |
| 53 | + needs: analyze |
| 54 | + runs-on: ${{ matrix.os }} |
| 55 | + strategy: |
| 56 | + fail-fast: false |
| 57 | + matrix: |
| 58 | + # Add macos-latest and/or windows-latest if relevant for this package. |
| 59 | + os: [ubuntu-latest] |
| 60 | + sdk: [3.4, dev] |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 |
| 63 | + - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 |
| 64 | + with: |
| 65 | + sdk: ${{ matrix.sdk }} |
| 66 | + - id: install |
| 67 | + name: Install dependencies |
| 68 | + run: dart pub get |
| 69 | + - name: Run VM tests |
| 70 | + run: dart test --platform vm --test-randomize-ordering-seed=random |
| 71 | + if: always() && steps.install.outcome == 'success' |
| 72 | + - name: Run Chrome tests |
| 73 | + run: dart test --platform chrome --test-randomize-ordering-seed=random |
| 74 | + if: always() && steps.install.outcome == 'success' |
| 75 | + - name: Run Chrome tests - wasm |
| 76 | + run: dart test --platform chrome --compiler dart2wasm |
| 77 | + if: always() && steps.install.outcome == 'success' |
0 commit comments