Skip to content

Commit

Permalink
fix: flutter coverage (#661)
Browse files Browse the repository at this point in the history
* fix: flutter coverage

* chore: update ci version

* feat: adds api coverage

* feat: normalize pat

* fix: sed

* fix: sed

* fix: sed
  • Loading branch information
kukkok3 authored Aug 6, 2024
1 parent ef75746 commit 178813f
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 18 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/generate-allure-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ jobs:
- name: Normalize coverage report paths
run: |
sed -i -e 's/SF:\/root/SF:catalyst-gateway/g' ${{ env.COVERAGE_REPORT_PATH }}/cat-gateway.coverage.info
sed -i -e 's/SF:lib/SF:catalyst_voices\/lib/g' ${{ env.COVERAGE_REPORT_PATH }}/lcov.info
cat ${{ env.COVERAGE_REPORT_PATH }}/cat-gateway.coverage.info
sed -i -e 's/SF:/SF:catalyst-gateway\/tests\/api_tests\//g' ${{ env.COVERAGE_REPORT_PATH }}/api-tests.coverage.info
- name: Coveralls
env:
Expand All @@ -188,6 +187,18 @@ jobs:
base-path: "/home/runner/work/catalyst-voices/catalyst-voices/"
parallel: true

- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: coverallsapp/github-action@v2
with:
path-to-lcov: "${{ env.COVERAGE_REPORT_PATH }}/api-tests.coverage.info"
allow-empty: true
debug: true
flag-name: api-test
base-path: "/home/runner/work/catalyst-voices/catalyst-voices/"
parallel: true

- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -200,6 +211,7 @@ jobs:
base-path: "/home/runner/work/catalyst-voices/catalyst-voices/"
parallel: true


upload-coverage-report:
name: Upload coverage report
needs: [generate-coverage-report]
Expand Down
6 changes: 3 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.1.20 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.1.20 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.20 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.1.21 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.1.21 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.21 AS postgresql-ci

FROM debian:stable-slim

Expand Down
6 changes: 3 additions & 3 deletions catalyst-gateway-crates/c509-certificate/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.20 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.21 AS rust-ci

# builder : Set up our target toolchains, and copy our files.
builder:
Expand All @@ -23,9 +23,9 @@ build:
--args1="--libs=c509-certificate"

RUN cargo install wasm-pack --version=0.12.1 --locked

# js-wasm-package-locally : Generate the wasm package and save it locally
js-wasm-package-locally:
js-wasm-package-locally:
FROM +build
RUN wasm-pack build --target web
SAVE ARTIFACT ./pkg AS LOCAL ./pkg
4 changes: 2 additions & 2 deletions catalyst-gateway/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.20 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mithril_snapshot:v3.1.20 AS mithril-snapshot-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.21 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mithril_snapshot:v3.1.21 AS mithril-snapshot-ci

#cspell: words rustfmt toolsets USERARCH

Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/event-db/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# the database and its associated software.
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.20 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.21 AS postgresql-ci

# cspell: words

Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION 0.8
IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.1.20 AS spectral-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.1.21 AS spectral-ci

# test-lint-openapi - OpenAPI linting from an artifact
# testing whether the OpenAPI generated during build stage follows good practice.
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/tests/api_tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.20 AS python-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.21 AS python-ci

builder:
FROM python-ci+python-base
Expand Down
2 changes: 1 addition & 1 deletion catalyst_voices/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8

IMPORT ../catalyst-gateway AS catalyst-gateway
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.1.20 AS flutter-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.1.21 AS flutter-ci

# Copy all the necessary files and running bootstrap
builder:
Expand Down
2 changes: 1 addition & 1 deletion catalyst_voices/uikit_example/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8

IMPORT ../ AS catalyst-voices
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.1.20 AS flutter-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.1.21 AS flutter-ci

# local-build-web - build web version of UIKit example.
# Prefixed by "local" to make sure it's not auto triggered, the target was
Expand Down
2 changes: 1 addition & 1 deletion docs/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.1.20 AS docs-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.1.21 AS docs-ci

IMPORT .. AS repo
IMPORT ../catalyst-gateway AS catalyst-gateway
Expand Down
5 changes: 3 additions & 2 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ scripts:
# cleanup from previous build and create new folders
rm -fR $MELOS_ROOT_PATH/test_reports
mkdir $MELOS_ROOT_PATH/test_reports
# run tests, generate junit reports in /test_reports/ & code coverage report
melos exec -c 1 --dir-exists="test" -- \
"flutter test --reporter expanded --coverage --machine | tojunit --output $MELOS_ROOT_PATH/test_reports/MELOS_PACKAGE_NAME.junit-report.xml"
Expand All @@ -90,7 +90,8 @@ scripts:
'*.freezed.dart' \
'lib/generated/**'
mv ./catalyst_voices/coverage .
dart pub global run combine_coverage --repo-path=.
description: |
Run `flutter test` for all packages and generate junit and coverage reports.
The test reports are saved in /test_reports folder.
Expand Down

0 comments on commit 178813f

Please sign in to comment.