example: Combine all examples into single example #12
This file contains hidden or 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: package:physical | |
| permissions: read-all | |
| on: | |
| push: | |
| branches: [ main, github-actions-test, 'test/*' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sdk: [dev] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Check formatting | |
| run: dart format --output=none --set-exit-if-changed . | |
| - name: Analyze code | |
| run: dart analyze --fatal-infos | |
| examples: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sdk: [stable] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Run examples | |
| run: for f in example/*.dart; do dart run "$f"; done | |
| test: | |
| needs: analyze | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sdk: [dev, '3.3'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Run VM tests | |
| run: dart test | |
| coverage: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: dev | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Install coverage | |
| run: dart pub global activate coverage | |
| - name: Collect and report coverage | |
| run: dart pub global run coverage:test_with_coverage | |
| - name: Upload coverage | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| file: coverage/lcov.info |