-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (76 loc) · 2.16 KB
/
flutter.yml
File metadata and controls
83 lines (76 loc) · 2.16 KB
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
76
77
78
79
80
81
82
83
name: flutter
on:
pull_request:
push:
branches:
- master
tags:
- "*.*"
jobs:
check:
runs-on: ${{
github.event.repository.private &&
fromJSON('["self-hosted", "macOS"]') ||
'ubuntu-latest'
}}
outputs:
check_os: ${{ steps.determine_check_os.outputs.os_list }}
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: stable
- run: flutter format .
- name: "Check that there are no changes after formatting"
run: |
if [ -n "$(git status --porcelain)" ]; then
echo Working directory not clean after formatting. Please apply the
echo following changes:
git diff
false
fi
- run: flutter analyze
- run: flutter test --coverage
- uses: codecov/codecov-action@v1
- name: "Read pubspec.yaml"
id: pubspec
run: >
ruby -ryaml -e
'
print "::set-output name=publish_to::",
YAML.load_file("pubspec.yaml")["publish_to"]
'
- name: "Validate the package for publishing"
run: flutter packages pub publish --dry-run
if: steps.pubspec.outputs.publish_to != 'none'
- name: "Determine OS to test the package on"
id: determine_check_os
run: |
check_os='"ubuntu-latest"'
if [ -e ios ]; then
check_os+=',"macOS-latest"'
fi
if [ -e android ]; then
check_os+=',"windows-latest"'
fi
echo "::set-output name=os_list::[${check_os}]"
build:
needs: check
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.check.outputs.check_os) }}
flutter_channel: [beta, stable]
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: ${{ matrix.flutter_channel }}
- working-directory: example
run: >
flutter build
${{ runner.os == 'macOS' && 'ios --no-codesign' || 'apk' }}
--debug