blob: 2aa4542e251829b101873a45cfdcb704ad1a4c18 [file] [log] [blame]
name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PUB_ENVIRONMENT: bot.github
PUB_CACHE: ".dart_tool/pub_cache"
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
- uses: actions/cache@v2
with:
path: .dart_tool
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: .dart_tool
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