1name: '📦 Packages'
 2
 3on:
 4  push:
 5    branches:
 6      - 'main'
 7    paths:
 8      - "health_data_store/**"
 9      - ".github/workflows/pkg-CI.yml"
10  workflow_dispatch:
11
12jobs:
13  test-health_data_store:
14    name: '🧪 Test'
15    runs-on: ubuntu-latest
16 
17    steps:
18    - name: Checkout code
19      uses: actions/checkout@v4
20      with:
21        # ensures there are no unexpected directories needed
22        sparse-checkout: |
23          health_data_store
24    - name: Setup dart
25      uses: dart-lang/setup-dart@v1
26      with:
27        sdk: stable
28    - run: sudo apt-get -y install libsqlite3-dev
29
30    - name: Get dependencies
31      run: |
32        dart pub get
33        dart pub global activate coverage
34      working-directory: ./health_data_store
35    - name: Generate code
36      run: dart run build_runner build
37      working-directory: ./health_data_store
38    - name: Analyze code
39      run: dart analyze
40      working-directory: ./health_data_store
41    - name: Run tests
42      run: |
43        dart test --coverage=coverage
44        format_coverage --lcov --in=coverage --out=coverage.lcov --report-on=lib
45      working-directory: ./health_data_store
46    - uses: actions/upload-artifact@v4
47      with:
48        name: health_data_store-coverage
49        path: health_data_store/coverage.lcov