-
-
Notifications
You must be signed in to change notification settings - Fork 54
116 lines (109 loc) · 3.06 KB
/
check_pr.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
name: Check PR
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 0"
jobs:
verify_commits:
runs-on: ubuntu-latest
steps:
- name: Conventional PRs
uses: Namchee/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
issue: false
verified_commits: true
close: false
report: false
check-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Activate melos
run: dart pub global activate melos 2.9.0
- name: Validate publish
run: melos publish --dry-run --yes | tee ./out
- name: Test if changed
run: |
if grep -q "The following packages will be validated only" out; then
PACKAGES=$(cat out | grep -E "Publishing [a-z]" | sed -E 's/Publishing ([a-z_]+).+/\1/g')
for package in $PACKAGES; do
melos exec --scope="$package" -- "dart pub get"
melos exec --scope="$package" -- "dart analyze --fatal-infos ."
melos exec --scope="$package" --dir-exists=test -- "dart test"
done
else
echo "Packages will not be published. Skipping tests."
fi
analyze:
runs-on: ubuntu-latest
strategy:
matrix:
channel:
- beta
- stable
# - dev
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
- name: Activate melos
run: dart pub global activate melos 2.9.0
- name: Bootstrap melos
run: melos bs
- name: Analyze package
run: melos run analyze --no-select
build:
runs-on: ubuntu-latest
strategy:
matrix:
channel:
- beta
- stable
# - dev
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
- name: Activate melos
run: dart pub global activate melos 2.9.0
- name: Bootstrap melos
run: melos bs
- name: Build dart
run: melos run build_dart --no-select
- name: Build fluter
run: melos run build_flutter --no-select
- name: Bootstrap melos
run: melos bs
- name: Check if changed
run: git diff --exit-code ':!**/pubspec.lock'
test:
runs-on: ubuntu-latest
strategy:
matrix:
channel:
- beta
- stable
# - dev
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
- name: Activate melos
run: dart pub global activate melos 2.9.0
- name: Bootstrap melos
run: melos bs
- name: Run tests dart
run: melos run test_dart --no-select
- name: Run tests flutter
run: melos run test_flutter --no-select