-
-
Notifications
You must be signed in to change notification settings - Fork 149
75 lines (64 loc) · 2.1 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- 'main'
jobs:
build:
name: Run on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: wasabeef/[email protected]
id: asdf
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.asdf.outputs.flutter }}
channel: stable
cache: true
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ steps.asdf.outputs.dart }}
- name: Set environment
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Set environment
if: startsWith(matrix.os, 'windows')
run: echo "%LOCALAPPDATA%\Pub\Cache\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Get dependencies for macos and ubuntu
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
run: |
dart pub global activate melos
melos bootstrap
- name: Get dependencies for Windows
if: startsWith(matrix.os, 'windows')
run: |
dart pub global activate melos
# FIXME: CI randomly fail
melos exec -c 1 -- flutter pub get
melos bootstrap
- name: Run tests for our dart project.
if: startsWith(matrix.os, 'ubuntu')
run: |
melos test
- name: Run coverage
if: startsWith(matrix.os, 'ubuntu')
run: |
melos coverage
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./packages/core/coverage.lcov
- name: Generate example
run: |
melos run gen:examples:command --no-select
melos run gen:examples:build_runner --no-select
- name: Check for any formatting and statically analyze the code.
run: |
melos format
melos analyze