1
- name : test
1
+ name : Test
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
push :
6
6
branches : [master]
7
- paths : [" **.dart", " **.yaml" ]
7
+ paths : [' **.dart', ' **.yaml', '**.yml' ]
8
8
pull_request :
9
9
branches : [master]
10
- paths : ["**.dart", "**.yaml"]
11
- schedule :
12
- - cron : " 0 0 * * 5" # m h d M w
10
+ paths : ['**.dart', '**.yaml', '**.yml']
13
11
14
12
jobs :
15
- build :
13
+ coverage :
16
14
if : github.repository == 'bitanon/hashlib_codecs'
17
- runs-on : ${{ matrix.os }}
18
15
strategy :
19
16
matrix :
20
- os : [ubuntu-latest] # macos-latest, windows-latest
21
- sdk : ["2.14.0", "2.19.6", "stable", "dev"]
17
+ os : [ubuntu-latest]
18
+ sdk : ['stable']
19
+ runs-on : ${{ matrix.os }}
20
+ steps :
21
+ - uses : actions/checkout@v4
22
+
23
+ - uses : dart-lang/setup-dart@v1
24
+ with :
25
+ sdk : ${{ matrix.sdk }}
26
+
27
+ - name : ' Install global packages'
28
+ run : |
29
+ dart pub global activate coverage
30
+ dart pub global activate cobertura
31
+ dart pub global activate junitreport
32
+
33
+ - name : Run tests with coverage
34
+ run : bash ./scripts/coverage.sh
35
+
36
+ - name : Upload results to Codecov
37
+ uses : codecov/codecov-action@v4
38
+ with :
39
+ token : ${{ secrets.CODECOV_TOKEN }}
40
+ file : ./coverage/cobertura.xml
22
41
42
+ - name : Upload test results to Codecov
43
+ if : ${{ !cancelled() }}
44
+ uses : codecov/test-results-action@v1
45
+ with :
46
+ token : ${{ secrets.CODECOV_TOKEN }}
47
+ file : ./coverage/junit.xml
48
+
49
+ test-on-stable :
50
+ strategy :
51
+ matrix :
52
+ os : [ubuntu-latest, macos-latest, windows-latest]
53
+ sdk : ['stable']
54
+ runs-on : ${{ matrix.os }}
23
55
steps :
24
- - uses : actions/checkout@v3
56
+ - uses : actions/checkout@v4
25
57
26
- # You can specify other versions if desired, see documentation here:
27
- # https://github.com/dart-lang/setup-dart/blob/main/README.md
28
- -
uses :
dart-lang/[email protected]
58
+ - uses : dart-lang/setup-dart@v1
29
59
with :
30
60
sdk : ${{ matrix.sdk }}
31
61
@@ -38,12 +68,46 @@ jobs:
38
68
- name : Analyze project source
39
69
run : dart analyze --fatal-infos
40
70
41
- - if : matrix.sdk != '2.14.0'
42
- name : Generate documentation
43
- run : dart doc --validate-links
71
+ - name : Run tests
72
+ run : dart test
73
+
74
+ test-on-legacy :
75
+ strategy :
76
+ matrix :
77
+ os : [ubuntu-latest, windows-latest]
78
+ sdk : ['2.14']
79
+ runs-on : ${{ matrix.os }}
80
+ steps :
81
+ - uses : actions/checkout@v4
82
+
83
+ - uses : dart-lang/setup-dart@v1
84
+ with :
85
+ sdk : ${{ matrix.sdk }}
86
+
87
+ - name : Run tests
88
+ run : dart test
89
+
90
+ test-on-beta :
91
+ strategy :
92
+ matrix :
93
+ os : [ubuntu-latest]
94
+ sdk : ['beta']
95
+ runs-on : ${{ matrix.os }}
96
+ steps :
97
+ - uses : actions/checkout@v4
98
+
99
+ - uses : dart-lang/setup-dart@v1
100
+ with :
101
+ sdk : ${{ matrix.sdk }}
102
+
103
+ - name : Install dependencies
104
+ run : dart pub get
44
105
45
- - name : Run tests on vm
46
- run : dart test -p vm
106
+ - name : Verify formatting
107
+ run : dart format --output=none --set-exit-if-changed .
108
+
109
+ - name : Analyze project source
110
+ run : dart analyze --fatal-infos
47
111
48
- - name : Run tests on node
49
- run : dart test -p node
112
+ - name : Run tests
113
+ run : dart test
0 commit comments