Skip to content

chore: use codecov test-analytics #3152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/actions/dart-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ inputs:
directory:
description: The directory to run tests in
required: false
default: ''
default: ""
web:
description: Whether to run tests for web
required: false
default: 'true'
default: "true"

runs:
using: composite
Expand All @@ -22,17 +22,23 @@ runs:
shell: bash
working-directory: ${{ inputs.directory }}

- name: Install flutter_junitreport
shell: bash
run: |
dart pub global activate --source git https://github.com/waffiqaziz/flutter-junitreport.git --git-ref main

- name: Test VM
working-directory: ${{ inputs.directory }}
shell: bash
run: |
testCmd="dart test -p vm --test-randomize-ordering-seed=random --chain-stack-traces"
if ${{ (matrix.os == 'ubuntu' && matrix.sdk == 'stable' && 'true') || 'false' }} ; then
$testCmd --coverage=coverage
$testCmd --coverage=coverage --reporter json > test-vm.jsonl
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
else
$testCmd
$testCmd --reporter json > test-vm.jsonl
fi
dart pub global run flutter_junitreport:tojunit --input test-vm.jsonl --output TEST-vm-junit.xml

- name: Test dart2js
if: ${{ inputs.web == 'true' }}
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- release/**
pull_request:
paths:
- '!**/*.md'
- '!**/class-diagram.svg'
- '.github/workflows/dart.yml'
- '.github/workflows/analyze.yml'
- '.github/actions/dart-test/**'
- '.github/actions/coverage/**'
- 'packages/dart/**'
- "!**/*.md"
- "!**/class-diagram.svg"
- ".github/workflows/dart.yml"
- ".github/workflows/analyze.yml"
- ".github/actions/dart-test/**"
- ".github/actions/coverage/**"
- "packages/dart/**"

jobs:
cancel-previous-workflow:
Expand All @@ -24,15 +24,15 @@ jobs:
access_token: ${{ github.token }}

build:
name: '${{ matrix.os }} | ${{ matrix.sdk }}'
name: "${{ matrix.os }} | ${{ matrix.sdk }}"
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu]
sdk:
- '3.5'
- "3.5"
- stable
- beta
include:
Expand All @@ -55,6 +55,15 @@ jobs:
coverage: sentry
min-coverage: 85

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # pin@v1.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: dart-tests-${{ runner.os }}-${{ matrix.sdk }}
flags: dart
verbose: true

- name: Build example
working-directory: packages/dart/example
run: |
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ jobs:
coverage: sentry_logging
min-coverage: 90

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # pin@v1.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: dart-tests-${{ runner.os }}-${{ matrix.sdk }}
flags: dart
verbose: true

analyze:
uses: ./.github/workflows/analyze.yml
with:
Expand Down
Loading