Skip to content

Fix stats tests

Fix stats tests #26

name: Static Analysis & Tests
on:
pull_request:
push:
branches:
- main
- refresh
jobs:
bloc_flutter:
name: bloc_flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./bloc_flutter
bloc_library:
name: bloc_library
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./bloc_library
blocs:
name: blocs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/dart_analysis_and_tests
with:
working-directory: ./blocs
change_notifier_provider:
name: change_notifier_provider
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./change_notifier_provider
freezed_provider_value_notifier:
name: freezed_provider_value_notifier
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./freezed_provider_value_notifier
inherited_widget:
name: inherited_widget
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./inherited_widget
mobx:
name: mobx
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./mobx
mvi_base:
name: mvi_base
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/dart_analysis_and_tests
with:
working-directory: ./mvi_base
mvi_flutter:
name: mvi_flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./mvi_flutter
redux:
name: redux
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./redux
scoped_model:
name: scoped_model
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./scoped_model
signals:
name: signals
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./signals
simple_bloc_flutter:
name: simple_bloc_flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./simple_bloc_flutter
simple_blocs:
name: simple_blocs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/dart_analysis_and_tests
with:
working-directory: ./simple_blocs
todos_repository_local_storage:
name: todos_repository_local_storage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./todos_repository_local_storage
run-integration-tests: false
vanilla:
name: vanilla
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis & Tests
uses: ./.github/actions/flutter_analysis_and_tests
with:
working-directory: ./vanilla
read_coverage:
name: Read Combined Coverage Files
runs-on: ubuntu-latest
needs:
- change_notifier_provider
- inherited_widget
- mobx
- mvi_base
- mvi_flutter
- redux
- scoped_model
- signals
- simple_bloc_flutter
- simple_blocs
- todos_repository_local_storage
- vanilla
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Combine coverage files
run: |
combineCoverage() {
local artifact_dir=$1
local repo_dir=$2
# Extract the package directory path from the artifact name
# coverage-lcov-vanilla -> ./vanilla
local package_name=$(basename "$artifact_dir")
local package_dir="./${package_name#coverage-lcov-}"
escapedPath="$(echo $package_dir | sed 's/\//\\\//g')"
if [[ -d "$artifact_dir" ]]; then
# Find the lcov.info file in the artifact directory
for lcov_file in "$artifact_dir"/*.info; do
if [[ -f "$lcov_file" ]]; then
echo "Combining coverage from $package_dir"
# combine line coverage info from package tests to a common file
sed "s/^SF:lib/SF:$escapedPath\/lib/g" "$lcov_file" >> "$repo_dir/lcov.info"
break
fi
done
fi
}
# Initialize the combined coverage file
touch lcov.info
# Combine coverage from all downloaded artifacts
for artifact_dir in coverage-lcov-*/; do
if [[ -d "$artifact_dir" ]]; then
combineCoverage "$artifact_dir" "."
fi
done
echo "Combined coverage file created:"
ls -la lcov.info
echo "First few lines of combined coverage:"
head -10 lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./lcov.info
disable_search: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}