-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 2.18 KB
/
checks.yaml
File metadata and controls
86 lines (72 loc) · 2.18 KB
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
name: "Checks"
on:
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]
jobs:
lint-dart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Flutter
uses: flutter-actions/setup-flutter@v4
with:
channel: stable
version: '3.38.8'
cache: true
cache-sdk: true
cache-key: ${{ runner.os }}-flutter-${{ hashFiles('pubspec.yaml') }}
- name: Install dependencies
run: flutter pub get
- name: Run checks
shell: bash
run: flutter analyze
- name: Run tests
shell: bash
run: flutter test --machine --coverage > test-results.json
- name: Publish test results
uses: dorny/test-reporter@v1
with:
name: Unit Tests
path: test-results.json
reporter: flutter-json
- name: Set outputs
id: set-outputs
run: |
COVERAGE_PATH="lcov.info"
TEST_RESULTS_PATH="test-results.json"
echo "coverage-path=$COVERAGE_PATH" >> $GITHUB_OUTPUT
echo "test-results-path=$TEST_RESULTS_PATH" >> $GITHUB_OUTPUT
- name: Upload coverage artifact
id: upload-coverage
uses: actions/upload-artifact@v4
with:
name: dart-coverage-${{ github.run_id }}
path: coverage/lcov.info
retention-days: 1
coverage-comment:
needs: lint-dart
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
name: dart-coverage-${{ github.run_id }}
path: dart-coverage
- uses: ./.github/actions/coverage-comment
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-dart: true
dart-coverage-path: dart-coverage/lcov.info
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./.github/actions/changelog
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
post-comment: true