1- name : test
1+ name : Test
22
33on :
44 workflow_dispatch :
55 push :
66 branches : [master]
7- paths : [" **.dart", " **.yaml" ]
7+ paths : [' **.dart', ' **.yaml', '**.yml' ]
88 pull_request :
99 branches : [master]
10- paths : ["**.dart", "**.yaml"]
11- schedule :
12- - cron : " 0 0 * * 5" # m h d M w
10+ paths : ['**.dart', '**.yaml', '**.yml']
1311
1412jobs :
15- build :
13+ coverage :
1614 if : github.repository == 'bitanon/hashlib_codecs'
17- runs-on : ${{ matrix.os }}
1815 strategy :
1916 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
2241
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 }}
2355 steps :
24- - uses : actions/checkout@v3
56+ - uses : actions/checkout@v4
2557
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/setup-dart@v1.3
58+ - uses : dart-lang/setup-dart@v1
2959 with :
3060 sdk : ${{ matrix.sdk }}
3161
@@ -38,12 +68,46 @@ jobs:
3868 - name : Analyze project source
3969 run : dart analyze --fatal-infos
4070
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
44105
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
47111
48- - name : Run tests on node
49- run : dart test -p node
112+ - name : Run tests
113+ run : dart test
0 commit comments