forked from dart-code-checker/dart-code-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (130 loc) · 3.9 KB
/
package_analyze.yaml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: "Analyze package"
on:
pull_request:
branches:
- master
paths:
- "bin/**"
- "example/**"
- "lib/**"
- "tool/**"
- "tools/**"
- ".github/workflows/package_analyze.yaml"
push:
branches:
- master
paths:
- "bin/**"
- "example/**"
- "lib/**"
- "tool/**"
- "tools/**"
- ".github/workflows/package_analyze.yaml"
jobs:
analysis:
runs-on: ubuntu-latest
steps:
- name: Validate semantic changelog update
if: ${{ github.event_name == 'pull_request' }}
uses: GetStream/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Stable Dart
uses: dart-lang/setup-dart@v1
with:
sdk: "stable"
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: dart pub get
- name: Run dependency validator
run: |
dart pub global activate dependency_validator
dart pub global run dependency_validator:dependency_validator
- name: Analyze project
run: dart analyze --fatal-warnings --fatal-infos .
- name: Analyze by Dart Code Metrics
uses: dart-code-checker/dart-code-metrics-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
folders: "bin, example, lib, test"
- name: Verify formatting
run: dart format --set-exit-if-changed .
- name: Compute the package score on pub.dev site
uses: axel-op/dart-package-analyzer@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
testing:
needs: analysis
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Install Stable Dart
uses: dart-lang/setup-dart@v1
with:
sdk: "stable"
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: dart pub get
- name: Run tests
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
if: success()
run: |
dart test --coverage=coverage
dart run coverage:format_coverage --packages=.packages -i coverage -o coverage/coverage.lcov --lcov --report-on=lib
dart run tool/uncovered_coverage.dart
dart test test/fake_test.dart --coverage=coverage
dart run coverage:format_coverage --packages=.packages -i coverage -o coverage/coverage.lcov --lcov --report-on=lib
bash <(curl -s https://codecov.io/bash) -f coverage/coverage.lcov
check-minimal-supported-dart-compatibility:
needs: analysis
runs-on: ubuntu-latest
steps:
- name: Install Dart 2.14.0
uses: dart-lang/setup-dart@v1
with:
sdk: "2.14.0"
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: dart pub downgrade
- name: Check compatibility
run: |
dart analyze --fatal-warnings --fatal-infos .
dart test
check-beta-dart-compatibility:
needs: analysis
runs-on: ubuntu-latest
steps:
- name: Install Dart beta
uses: dart-lang/setup-dart@v1
with:
sdk: "beta"
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: dart pub upgrade
- name: Check compatibility
run: |
dart analyze --fatal-warnings --fatal-infos .
dart test
check-windows-compatibility:
needs: analysis
runs-on: windows-latest
steps:
- name: Install Stable Dart
uses: dart-lang/setup-dart@v1
with:
sdk: "stable"
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: dart pub get
- name: Check compatibility
run: |
dart analyze --fatal-warnings --fatal-infos .
dart test