| name: build |
| |
| on: |
| push: |
| branches: [ main ] |
| pull_request: |
| branches: [ main ] |
| |
| jobs: |
| analyze: |
| runs-on: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v2 |
| - uses: dart-lang/setup-dart@v1 |
| - uses: actions/cache@v2 |
| with: |
| path: | |
| ${{ env.PUB_CACHE }} |
| pubspec.lock |
| key: dart-tool-${{ hashFiles('pubspec.yaml') }} |
| |
| - name: "Install dependencies" |
| run: dart pub upgrade |
| |
| - name: "Ensure formatted" |
| run: dart format --output=none --set-exit-if-changed . |
| |
| - name: "Analyze project" |
| run: dart analyze --fatal-infos |
| |
| test: |
| strategy: |
| matrix: |
| os: [ubuntu-latest, windows-latest, macOS-latest] |
| runs-on: ${{ matrix.os }} |
| # analyze creates the cache, avoid downloading dependencies again here |
| needs: analyze |
| |
| steps: |
| - uses: actions/checkout@v2 |
| - uses: dart-lang/setup-dart@v1 |
| - uses: actions/cache@v2 |
| with: |
| path: ${{ env.PUB_CACHE }} |
| key: dart-tool-${{ hashFiles('pubspec.yaml') }} |
| |
| - name: "Get dependencies" |
| run: dart pub get |
| |
| - name: "Download 7za" |
| run: dart run tool/download_7za.dart |
| if: runner.os == 'Windows' |
| |
| - name: "Run tests" |
| run: dart test |