From a26ccbb66b547f6390c1f712bbbfac844d2edae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 13:15:52 +0100 Subject: [PATCH 01/10] :green_heart: Fix CI coverage reporting --- .github/workflows/dart.yml | 54 ++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 8c57149d..67517511 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -214,19 +214,57 @@ jobs: - job_003 job_006: name: Coverage - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + sdk: [ stable ] + package: [ chopper, chopper_built_value, chopper_generator ] steps: - - uses: dart-lang/setup-dart@v1.3 + - name: Cache Pub hosted dependencies + uses: actions/cache@v3 with: - sdk: stable + path: "~/.pub-cache/hosted" + key: "os:${{ runner.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:${{ matrix.package }};commands:coverage" + restore-keys: | + os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:${{ matrix.package }} + os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }} + os:${{ matrix.os }};pub-cache-hosted + os:${{ matrix.os }} + - name: Setup Dart SDK + uses: dart-lang/setup-dart@v1 + with: + sdk: ${{ matrix.sdk }} - id: checkout uses: actions/checkout@v3 - - id: upload_coverage - name: chopper; tool/coverage.sh - run: bash tool/coverage.sh + - id: pub_upgrade + name: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - env: - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" + working-directory: ${{ matrix.package }} + run: dart pub upgrade + - id: install + name: Install coverage packages + if: "always() && steps.pub_upgrade.conclusion == 'success'" + working-directory: ${{ matrix.package }} + run: | + dart pub global activate coverage + dart pub global activate remove_from_coverage + - id: coverage + name: Collect and report coverage + if: "always() && steps.install.conclusion == 'success'" + working-directory: ${{ matrix.package }} + run: | + dart pub global run coverage:test_with_coverage + dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' + - id: upload_coverage + name: Upload coverage + if: "always() && steps.coverage.conclusion == 'success'" + working-directory: ${{ matrix.package }} + uses: codecov/codecov-action@v3 + with: + file: ./coverage/lcov.info + verbose: true needs: - job_001 - job_002 From 2a6c080f18bca6036046c73cb110f860a48b3730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 13:18:19 +0100 Subject: [PATCH 02/10] :green_heart: Fix CI coverage reporting --- .github/workflows/dart.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 67517511..1710c813 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -257,11 +257,10 @@ jobs: run: | dart pub global run coverage:test_with_coverage dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' - - id: upload_coverage - name: Upload coverage + - name: Upload coverage + uses: codecov/codecov-action@v3 if: "always() && steps.coverage.conclusion == 'success'" working-directory: ${{ matrix.package }} - uses: codecov/codecov-action@v3 with: file: ./coverage/lcov.info verbose: true From b47913c1736525fda8e34bf28e265c359da6d1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 13:20:09 +0100 Subject: [PATCH 03/10] :green_heart: Fix CI coverage reporting --- .github/workflows/dart.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 1710c813..efc1ed56 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -260,9 +260,8 @@ jobs: - name: Upload coverage uses: codecov/codecov-action@v3 if: "always() && steps.coverage.conclusion == 'success'" - working-directory: ${{ matrix.package }} with: - file: ./coverage/lcov.info + file: ./${{ matrix.package }}/coverage/lcov.info verbose: true needs: - job_001 From 8f6103aec3b71737b0f7f11ec9cd75048f10403a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 14:08:26 +0100 Subject: [PATCH 04/10] :green_heart: Fix CI coverage reporting --- .github/workflows/dart.yml | 52 ++++++-------------------------------- tool/coverage.sh | 45 ++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 53 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index efc1ed56..8c57149d 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -214,55 +214,19 @@ jobs: - job_003 job_006: name: Coverage - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - sdk: [ stable ] - package: [ chopper, chopper_built_value, chopper_generator ] + runs-on: ubuntu-latest steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@v3 + - uses: dart-lang/setup-dart@v1.3 with: - path: "~/.pub-cache/hosted" - key: "os:${{ runner.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:${{ matrix.package }};commands:coverage" - restore-keys: | - os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }};packages:${{ matrix.package }} - os:${{ matrix.os }};pub-cache-hosted;sdk:${{ matrix.sdk }} - os:${{ matrix.os }};pub-cache-hosted - os:${{ matrix.os }} - - name: Setup Dart SDK - uses: dart-lang/setup-dart@v1 - with: - sdk: ${{ matrix.sdk }} + sdk: stable - id: checkout uses: actions/checkout@v3 - - id: pub_upgrade - name: dart pub upgrade + - id: upload_coverage + name: chopper; tool/coverage.sh + run: bash tool/coverage.sh if: "always() && steps.checkout.conclusion == 'success'" - working-directory: ${{ matrix.package }} - run: dart pub upgrade - - id: install - name: Install coverage packages - if: "always() && steps.pub_upgrade.conclusion == 'success'" - working-directory: ${{ matrix.package }} - run: | - dart pub global activate coverage - dart pub global activate remove_from_coverage - - id: coverage - name: Collect and report coverage - if: "always() && steps.install.conclusion == 'success'" - working-directory: ${{ matrix.package }} - run: | - dart pub global run coverage:test_with_coverage - dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' - - name: Upload coverage - uses: codecov/codecov-action@v3 - if: "always() && steps.coverage.conclusion == 'success'" - with: - file: ./${{ matrix.package }}/coverage/lcov.info - verbose: true + env: + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" needs: - job_001 - job_002 diff --git a/tool/coverage.sh b/tool/coverage.sh index 8fb7f288..cd59cd99 100755 --- a/tool/coverage.sh +++ b/tool/coverage.sh @@ -1,11 +1,38 @@ #!/bin/bash -dart pub get -dart run test --coverage=coverage -dart run coverage:format_coverage --lcov \ - --in=coverage \ - --out=coverage/coverage.lcov \ - --packages=.packages \ - --report-on=lib - -curl -s https://codecov.io/bash | bash \ No newline at end of file +# ensure codecov token exists +if [ -z "$CODECOV_TOKEN" ]; then + echo "CODECOV_TOKEN is not set" + exit 1 +fi + +# install coverage tools +dart pub global activate coverage +dart pub global activate remove_from_coverage + +# install codecov uploader +curl -Os https://uploader.codecov.io/latest/linux/codecov +chmod +x codecov + +# ensure codecov uploaded downloaded +if [ ! -f codecov ]; then + echo "codecov uploader not found" + exit 1 +fi + +## loop through all the packages +PKGS=("chopper" "chopper_generator" "chopper_build_value") + +for PKG in "${PKGS[@]}" +do + # move to package directory + cd "$PKG" || exit + # run tests with coverage + dart pub global run coverage:test_with_coverage + # remove generated files from coverage + dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' + # if coverage/lcov.info exists, upload to codecov + [ -f coverage/lcov.info ] && ../codecov -t "$CODECOV_TOKEN" -f coverage/lcov.info + # move back to root directory + cd - || exit +done \ No newline at end of file From 1ec1c5eb137e3ad867daf483413e626e6e21110e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 14:10:21 +0100 Subject: [PATCH 05/10] :green_heart: Fix CI coverage reporting --- tool/coverage.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool/coverage.sh b/tool/coverage.sh index cd59cd99..7dbe9be0 100755 --- a/tool/coverage.sh +++ b/tool/coverage.sh @@ -27,6 +27,8 @@ for PKG in "${PKGS[@]}" do # move to package directory cd "$PKG" || exit + # install dependencies + dart pub get # run tests with coverage dart pub global run coverage:test_with_coverage # remove generated files from coverage From d2d8d2c9c591098d1258705d363e6b04ed911d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 14:34:35 +0100 Subject: [PATCH 06/10] :green_heart: Fix CI coverage reporting --- tool/coverage.sh | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/tool/coverage.sh b/tool/coverage.sh index 7dbe9be0..18190252 100755 --- a/tool/coverage.sh +++ b/tool/coverage.sh @@ -1,32 +1,15 @@ #!/bin/bash - -# ensure codecov token exists -if [ -z "$CODECOV_TOKEN" ]; then - echo "CODECOV_TOKEN is not set" - exit 1 -fi - # install coverage tools dart pub global activate coverage dart pub global activate remove_from_coverage -# install codecov uploader -curl -Os https://uploader.codecov.io/latest/linux/codecov -chmod +x codecov - -# ensure codecov uploaded downloaded -if [ ! -f codecov ]; then - echo "codecov uploader not found" - exit 1 -fi - ## loop through all the packages PKGS=("chopper" "chopper_generator" "chopper_build_value") for PKG in "${PKGS[@]}" do # move to package directory - cd "$PKG" || exit + pushd "$PKG" || exit # install dependencies dart pub get # run tests with coverage @@ -34,7 +17,7 @@ do # remove generated files from coverage dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' # if coverage/lcov.info exists, upload to codecov - [ -f coverage/lcov.info ] && ../codecov -t "$CODECOV_TOKEN" -f coverage/lcov.info + curl -s https://codecov.io/bash | bash # move back to root directory - cd - || exit + popd - || exit done \ No newline at end of file From b87d0b90f1fc337f52611d57568b2fd689553172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 14:42:23 +0100 Subject: [PATCH 07/10] :green_heart: Fix CI coverage reporting --- tool/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/coverage.sh b/tool/coverage.sh index 18190252..bb3681f6 100755 --- a/tool/coverage.sh +++ b/tool/coverage.sh @@ -19,5 +19,5 @@ do # if coverage/lcov.info exists, upload to codecov curl -s https://codecov.io/bash | bash # move back to root directory - popd - || exit + popd || exit done \ No newline at end of file From db93ec8f4ebe229c585d10fe2331bd45387543e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 14:44:42 +0100 Subject: [PATCH 08/10] :green_heart: Fix CI coverage reporting --- tool/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/coverage.sh b/tool/coverage.sh index bb3681f6..50884ec5 100755 --- a/tool/coverage.sh +++ b/tool/coverage.sh @@ -17,7 +17,7 @@ do # remove generated files from coverage dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' # if coverage/lcov.info exists, upload to codecov - curl -s https://codecov.io/bash | bash + [ -f coverage/lcov.info ] && bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info # move back to root directory popd || exit done \ No newline at end of file From 471822a88fa1f71c24741cf3fc41b7cbf14d0f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 15:02:32 +0100 Subject: [PATCH 09/10] :green_heart: Fix CI coverage reporting --- .github/workflows/dart.yml | 59 +++++++++++------------ chopper/mono_pkg.yaml | 2 +- chopper_built_value/mono_pkg.yaml | 2 +- mono_repo.yaml | 78 ++++++++++++++++++++++--------- tool/ci.sh | 10 ++-- tool/coverage.sh | 23 --------- 6 files changed, 90 insertions(+), 84 deletions(-) delete mode 100755 tool/coverage.sh diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 8c57149d..444801b6 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -127,14 +127,14 @@ jobs: - job_001 - job_002 job_004: - name: "unit_test; PKGS: chopper, chopper_built_value; `dart test -p chrome`" + name: "unit_test; PKGS: chopper, chopper_built_value; `dart pub global run coverage:test_with_coverage`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_with_coverage" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value os:ubuntu-latest;pub-cache-hosted;sdk:stable @@ -144,6 +144,8 @@ jobs: uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable + - name: "Activate package:coverage" + run: "dart pub global activate coverage '>=1.5.0'" - id: checkout name: Checkout repository uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab @@ -152,32 +154,44 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: chopper - - name: "chopper; dart test -p chrome" - run: dart test -p chrome + - name: "chopper; dart pub global run coverage:test_with_coverage" + run: "dart pub global run coverage:test_with_coverage" if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'" working-directory: chopper + - name: Upload coverage to codecov.io + uses: codecov/codecov-action@main + with: + files: chopper/coverage/lcov.info + fail_ci_if_error: true + name: coverage_00 - id: chopper_built_value_pub_upgrade name: chopper_built_value; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: chopper_built_value - - name: "chopper_built_value; dart test -p chrome" - run: dart test -p chrome + - name: "chopper_built_value; dart pub global run coverage:test_with_coverage" + run: "dart pub global run coverage:test_with_coverage" if: "always() && steps.chopper_built_value_pub_upgrade.conclusion == 'success'" working-directory: chopper_built_value + - name: Upload coverage to codecov.io + uses: codecov/codecov-action@main + with: + files: chopper_built_value/coverage/lcov.info + fail_ci_if_error: true + name: coverage_01 needs: - job_001 - job_002 - job_003 job_005: - name: "unit_test; PKGS: chopper, chopper_built_value; `dart test`" + name: "unit_test; PKGS: chopper, chopper_built_value; `dart test -p chrome`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_0" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value os:ubuntu-latest;pub-cache-hosted;sdk:stable @@ -195,8 +209,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: chopper - - name: chopper; dart test - run: dart test + - name: "chopper; dart test -p chrome" + run: dart test -p chrome if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'" working-directory: chopper - id: chopper_built_value_pub_upgrade @@ -204,32 +218,11 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: chopper_built_value - - name: chopper_built_value; dart test - run: dart test + - name: "chopper_built_value; dart test -p chrome" + run: dart test -p chrome if: "always() && steps.chopper_built_value_pub_upgrade.conclusion == 'success'" working-directory: chopper_built_value needs: - job_001 - job_002 - job_003 - job_006: - name: Coverage - runs-on: ubuntu-latest - steps: - - uses: dart-lang/setup-dart@v1.3 - with: - sdk: stable - - id: checkout - uses: actions/checkout@v3 - - id: upload_coverage - name: chopper; tool/coverage.sh - run: bash tool/coverage.sh - if: "always() && steps.checkout.conclusion == 'success'" - env: - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 diff --git a/chopper/mono_pkg.yaml b/chopper/mono_pkg.yaml index ed853726..8cce50b9 100644 --- a/chopper/mono_pkg.yaml +++ b/chopper/mono_pkg.yaml @@ -7,7 +7,7 @@ stages: - format - analyze: --fatal-infos . - unit_test: - - test: + - test_with_coverage: - test: -p chrome cache: diff --git a/chopper_built_value/mono_pkg.yaml b/chopper_built_value/mono_pkg.yaml index 3d4d539a..ae7b5f25 100644 --- a/chopper_built_value/mono_pkg.yaml +++ b/chopper_built_value/mono_pkg.yaml @@ -7,7 +7,7 @@ stages: - format - analyze: --fatal-infos . - unit_test: - - test: + - test_with_coverage: - test: -p chrome cache: diff --git a/mono_repo.yaml b/mono_repo.yaml index 08251824..064c5397 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -4,28 +4,64 @@ github: on: push: branches: - - master - - develop + - master + - develop pull_request: branches: - - master - - develop - on_completion: - - name: "Coverage" - runs-on: ubuntu-latest - steps: - - uses: dart-lang/setup-dart@v1.3 - with: - sdk: stable - - id: checkout - uses: actions/checkout@v3 - - id: upload_coverage - name: "chopper; tool/coverage.sh" - if: "always() && steps.checkout.conclusion == 'success'" - run: bash tool/coverage.sh - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - master + - develop +# on_completion: +# - name: Coverage +# runs-on: ubuntu-latest +# strategy: +# matrix: +# package: [ chopper, chopper_built_value, chopper_generator ] +# steps: +# - name: Cache Pub hosted dependencies +# uses: actions/cache@v3 +# with: +# path: "~/.pub-cache/hosted" +# key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:${{ matrix.package }};commands:coverage" +# restore-keys: | +# os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:${{ matrix.package }} +# os:ubuntu-latest;pub-cache-hosted;sdk:stable +# os:ubuntu-latest;pub-cache-hosted +# os:ubuntu-latest +# - name: Setup Dart SDK +# uses: dart-lang/setup-dart@v1 +# with: +# sdk: stable +# - id: checkout +# uses: actions/checkout@v3 +# - id: pub_upgrade +# name: dart pub upgrade +# if: "always() && steps.checkout.conclusion == 'success'" +# working-directory: ${{ matrix.package }} +# run: dart pub upgrade +# - id: install +# name: Install coverage packages +# if: "always() && steps.pub_upgrade.conclusion == 'success'" +# working-directory: ${{ matrix.package }} +# run: | +# dart pub global activate coverage +# dart pub global activate remove_from_coverage +# - id: coverage +# name: Collect and report coverage +# if: "always() && steps.install.conclusion == 'success'" +# working-directory: ${{ matrix.package }} +# run: | +# dart pub global run coverage:test_with_coverage +# dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' +# - name: Upload coverage +# uses: codecov/codecov-action@v3 +# if: "always() && steps.coverage.conclusion == 'success'" +# with: +# file: ./${{ matrix.package }}/coverage/lcov.info +# verbose: true merge_stages: -- analyzer_and_format -- unit_test \ No newline at end of file + - analyzer_and_format + - unit_test + +coverage_service: + - codecov \ No newline at end of file diff --git a/tool/ci.sh b/tool/ci.sh index ca07f3a6..7449806d 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -75,14 +75,14 @@ for PKG in ${PKGS}; do echo 'dart format --output=none --set-exit-if-changed .' dart format --output=none --set-exit-if-changed . || EXIT_CODE=$? ;; - test_0) - echo 'dart test' - dart test || EXIT_CODE=$? - ;; - test_1) + test) echo 'dart test -p chrome' dart test -p chrome || EXIT_CODE=$? ;; + test_with_coverage) + echo 'dart pub global run coverage:test_with_coverage' + dart pub global run coverage:test_with_coverage || EXIT_CODE=$? + ;; *) echo -e "\033[31mUnknown TASK '${TASK}' - TERMINATING JOB\033[0m" exit 64 diff --git a/tool/coverage.sh b/tool/coverage.sh deleted file mode 100755 index 50884ec5..00000000 --- a/tool/coverage.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# install coverage tools -dart pub global activate coverage -dart pub global activate remove_from_coverage - -## loop through all the packages -PKGS=("chopper" "chopper_generator" "chopper_build_value") - -for PKG in "${PKGS[@]}" -do - # move to package directory - pushd "$PKG" || exit - # install dependencies - dart pub get - # run tests with coverage - dart pub global run coverage:test_with_coverage - # remove generated files from coverage - dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' - # if coverage/lcov.info exists, upload to codecov - [ -f coverage/lcov.info ] && bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info - # move back to root directory - popd || exit -done \ No newline at end of file From d38ae763ae8b05226f143b5d97c69f1d42b716be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Sun, 14 May 2023 15:09:59 +0100 Subject: [PATCH 10/10] :green_heart: Fix CI coverage reporting --- mono_repo.yaml | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/mono_repo.yaml b/mono_repo.yaml index 064c5397..28e29828 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -10,54 +10,6 @@ github: branches: - master - develop -# on_completion: -# - name: Coverage -# runs-on: ubuntu-latest -# strategy: -# matrix: -# package: [ chopper, chopper_built_value, chopper_generator ] -# steps: -# - name: Cache Pub hosted dependencies -# uses: actions/cache@v3 -# with: -# path: "~/.pub-cache/hosted" -# key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:${{ matrix.package }};commands:coverage" -# restore-keys: | -# os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:${{ matrix.package }} -# os:ubuntu-latest;pub-cache-hosted;sdk:stable -# os:ubuntu-latest;pub-cache-hosted -# os:ubuntu-latest -# - name: Setup Dart SDK -# uses: dart-lang/setup-dart@v1 -# with: -# sdk: stable -# - id: checkout -# uses: actions/checkout@v3 -# - id: pub_upgrade -# name: dart pub upgrade -# if: "always() && steps.checkout.conclusion == 'success'" -# working-directory: ${{ matrix.package }} -# run: dart pub upgrade -# - id: install -# name: Install coverage packages -# if: "always() && steps.pub_upgrade.conclusion == 'success'" -# working-directory: ${{ matrix.package }} -# run: | -# dart pub global activate coverage -# dart pub global activate remove_from_coverage -# - id: coverage -# name: Collect and report coverage -# if: "always() && steps.install.conclusion == 'success'" -# working-directory: ${{ matrix.package }} -# run: | -# dart pub global run coverage:test_with_coverage -# dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' -# - name: Upload coverage -# uses: codecov/codecov-action@v3 -# if: "always() && steps.coverage.conclusion == 'success'" -# with: -# file: ./${{ matrix.package }}/coverage/lcov.info -# verbose: true merge_stages: - analyzer_and_format