💸 create FUNDING.yml #176
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: Dart CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
defaults: | |
run: | |
shell: bash | |
env: | |
PUB_ENVIRONMENT: bot.github | |
permissions: read-all | |
jobs: | |
analyze: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ macos-latest ] | |
sdk: [ stable ] | |
steps: | |
- name: Cache Pub hosted dependencies | |
uses: actions/cache@v3 | |
with: | |
path: "~/.pub-cache/hosted" | |
key: "os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:alfred_workflow;commands:codegen-format-analyze" | |
restore-keys: | | |
os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:alfred_workflow | |
os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }} | |
os:${{ matrix.os }};pub-cache-hosted | |
os:${{ matrix.os }} | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- id: checkout | |
name: Checkout repository | |
uses: actions/checkout@v3 | |
- id: install | |
name: Install dependencies | |
run: make install | |
- name: Run the build system for Dart code generation and modular compilation | |
run: make code_gen | |
- name: Check the formatting of one or more Dart files | |
run: make check_format | |
if: always() && steps.install.outcome == 'success' | |
- name: Analyze the project's Dart code | |
run: make analyze | |
if: always() && steps.install.outcome == 'success' | |
test: | |
needs: analyze | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ macos-latest ] | |
sdk: [ stable ] | |
steps: | |
- name: Cache Pub hosted dependencies | |
uses: actions/cache@v3 | |
with: | |
path: "~/.pub-cache/hosted" | |
key: "os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:alfred_workflow;commands:codegen-test" | |
restore-keys: | | |
os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:alfred_workflow | |
os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }} | |
os:${{ matrix.os }};pub-cache-hosted | |
os:${{ matrix.os }} | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- id: checkout | |
name: Checkout repository | |
uses: actions/checkout@v3 | |
- id: install | |
name: Install dependencies | |
run: make install | |
- name: Run the build system for Dart code generation and modular compilation | |
run: make code_gen | |
- name: Run VM tests | |
run: make tests | |
if: always() && steps.install.outcome == 'success' | |
coverage: | |
needs: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ macos-latest ] | |
sdk: [ stable ] | |
steps: | |
- name: Cache Pub hosted dependencies | |
uses: actions/cache@v3 | |
with: | |
path: "~/.pub-cache/hosted" | |
key: "os:${{ runner.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:alfred_workflow;commands:codegen-coverage" | |
restore-keys: | | |
os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:alfred_workflow | |
os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }} | |
os:${{ matrix.os }};pub-cache-hosted | |
os:${{ matrix.os }} | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- id: checkout | |
name: Checkout repository | |
uses: actions/checkout@v3 | |
- id: install | |
name: Install dependencies | |
run: | | |
make install | |
dart pub global activate coverage | |
dart pub global activate remove_from_coverage | |
- name: Run the build system for Dart code generation and modular compilation | |
run: make code_gen | |
- name: Collect and report coverage | |
run: | | |
dart pub global run coverage:test_with_coverage | |
dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage/lcov.info | |
verbose: true |