Skip to content

chore: refactor CI #367

chore: refactor CI

chore: refactor CI #367

Workflow file for this run

name: CI
on:
pull_request:
push:
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:alice;commands:analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:alice
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
- uses: actions/checkout@v4
- name: Install Melos
run: dart pub global activate melos
- name: Bootstrap the project
run: melos bootstrap
- name: Check the formatting of one or more Dart files
run: melos format --output none --set-exit-if-changed
- name: Analyze the project's Dart code
run: melos analyze --fatal-infos
- name: Invertase Analyze
uses: invertase/github-action-dart-analyzer@v1
with:
fatal-infos: true
fatal-warnings: true
working-directory: ./packages
test:
name: "Test"
needs: 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:alice;commands:test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:alice
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
- uses: actions/checkout@v4
- name: Install Melos
run: dart pub global activate melos
- name: Bootstrap the project
run: melos bootstrap
- name: Run tests
run: melos test
env:
CI: true