diff --git a/.github/actions/dart-test/action.yml b/.github/actions/dart-test/action.yml index cd4fd6c2a1..62d568ccb4 100644 --- a/.github/actions/dart-test/action.yml +++ b/.github/actions/dart-test/action.yml @@ -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 @@ -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' }} diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 35f5ce4e15..76eac84da7 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -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: @@ -24,7 +24,7 @@ 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: @@ -32,7 +32,7 @@ jobs: matrix: os: [ubuntu] sdk: - - '3.5' + - "3.5" - stable - beta include: @@ -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: | diff --git a/.github/workflows/logging.yml b/.github/workflows/logging.yml index 300605ea29..491222c95c 100644 --- a/.github/workflows/logging.yml +++ b/.github/workflows/logging.yml @@ -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: