Merge pull request #1 from techouse/chore/qs_dart #2
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: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
env: | |
PUB_ENVIRONMENT: bot.github | |
permissions: read-all | |
jobs: | |
analyze: | |
name: "Analyze" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache Pub hosted dependencies | |
uses: actions/cache@v4 | |
with: | |
path: "~/.pub-cache/hosted" | |
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:dart_api_query;commands:codegen-test" | |
restore-keys: | | |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:dart_api_query | |
os:ubuntu-latest;pub-cache-hosted;sdk:stable | |
os:ubuntu-latest;pub-cache-hosted | |
os:ubuntu-latest | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- id: checkout | |
name: Checkout repository | |
uses: actions/checkout@v4 | |
- id: install | |
name: Install dependencies | |
run: dart pub get | |
- name: Check the formatting of one or more Dart files | |
run: dart format lib test --output=none --set-exit-if-changed . | |
- name: Analyze the project's Dart code | |
run: dart analyze lib test --fatal-infos | |
test: | |
name: "Test" | |
needs: analyze | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- platform: chrome | |
- platform: vm | |
steps: | |
- name: Cache Pub hosted dependencies | |
uses: actions/cache@v4 | |
with: | |
path: "~/.pub-cache/hosted" | |
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:dart_api_query;commands:codegen-test" | |
restore-keys: | | |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:dart_api_query | |
os:ubuntu-latest;pub-cache-hosted;sdk:stable | |
os:ubuntu-latest;pub-cache-hosted | |
os:ubuntu-latest | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- id: checkout | |
name: Checkout repository | |
uses: actions/checkout@v4 | |
- id: install | |
name: Install dependencies | |
run: dart pub get | |
- name: Run the project's tests | |
run: dart test --platform ${{ matrix.platform }} |