-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (47 loc) · 1.48 KB
/
coverage.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
name: CI/Coverage
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
dart-check:
name: Coverage Check
runs-on: ubuntu-latest
steps:
- name: 📚 Checkout
uses: actions/checkout@v4
- name: 🐦 Set up Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: 📦 Install dependencies
run: dart pub get
- name: 📝 Copy .env.example to .env
run: cp .env.example .env
- name: 🐘 Setup PostgreSQL
uses: ikalnytskyi/action-setup-postgres@v6
- name: 📦 Install Prisma
run: npm install prisma -g
- name: 🐘 Push database
run: prisma db push
- name: 🧪 Run tests
run: |
dart run coverage:test_with_coverage
sudo apt-get install lcov -y
# Keep only entries for handlers/*.dart and services/*.dart files (these are the files actually doing the business logic)
lcov --extract coverage/lcov.info "*/handlers/*" "*/services/*" -o coverage/lcov.info
continue-on-error: true
- name: 📊 Generate Coverage
id: coverage-report
uses: whynotmake-it/dart-coverage-assistant@v1.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lower_threshold: 60
upper_threshold: 90
compare_against_base: false