This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
129 lines (99 loc) · 2.86 KB
/
flutter-ci.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Flutter CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.0.x'
- name: Install Melos
run: flutter pub global activate melos
- name: Install lcov
run: sudo apt update && sudo apt install lcov
# subiquity
- name: Get subiquity dependencies
working-directory: ./packages/subiquity_client/subiquity
run: sudo ./scripts/installdeps.sh
- name: Check subiquity integration
run: ./scripts/subiquity_integration
- name: Prepare environment for subiquity
run: |
sudo loginctl enable-linger $USER
sudo systemctl start user@$UID.service
echo "XDG_RUNTIME_DIR=/run/user/$UID" >> $GITHUB_ENV
# test all packages
- name: Bootstrap workspace
run: melos bootstrap
- name: Run tests
run: melos run coverage
- name: Upload coverage results
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
analyze:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.0.x'
- name: Install Melos
run: flutter pub global activate melos
- name: Bootstrap workspace
run: melos bootstrap
- name: Check for any formatting issues
run: melos run format
- name: Check for any analyzer issues
run: melos run analyze
generate:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.0.x'
- name: Install Melos
run: flutter pub global activate melos
- name: Bootstrap workspace
run: melos bootstrap
- name: Generate source code
run: melos run generate
- name: Generate l10n files
run: melos run gen-l10n
- name: Warn about outdated generated files
if: github.event_name == 'pull_request'
run: |
if [ -n "$(git status --porcelain)" ]; then
git diff
for f in $(git ls-files --modified); do
echo "::warning ::$f may be outdated"
done
for f in $(git ls-files --others --exclude-standard); do
echo "::warning ::$f may be untracked"
done
exit 1
fi
- name: Create PR for outdated generated files
if: github.event_name == 'push'
uses: peter-evans/create-pull-request@v3
with:
title: 'Regenerate files'
commit-message: 'Regenerate files'