Skip to content
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

chore: enable codecov #12876

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/callable-get-package-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- name: Install
if: steps.cache-package-list.outputs.cache-hit != 'true'
# if: steps.cache-package-list.outputs.cache-hit != 'true'
run: yarn
shell: bash
# Need the repo checked out in order to read the file
- name: Dump Package List
if: steps.cache-package-list.outputs.cache-hit != 'true'
# if: steps.cache-package-list.outputs.cache-hit != 'true'
run: |
echo "packages=$(yarn lerna ls | egrep -v "lerna|Done|yarn" | jq -R -s -c 'split("\n")[:-1]')" > package-list.json
echo "packages=$(yarn lerna ll | egrep -v "lerna|Done|yarn" | jq -R -s -c 'split("\n")[:-1] | map({name: split(" ")[0], path: split(" ")[-1]})')" > package-list.json
- name: Get Package List
id: get_package_list
run: |
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/callable-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
get-package-list:
uses: ./.github/workflows/callable-get-package-list.yml
unit_test:
name: Unit Test - ${{ matrix.package }}
name: Unit Test - ${{ matrix.package.name }}
runs-on: ubuntu-latest
needs: get-package-list
strategy:
Expand All @@ -23,5 +23,25 @@ jobs:
- name: Run tests
working-directory: ./amplify-js
env:
TEST_PACKAGE: ${{ matrix.package }}
TEST_PACKAGE: ${{ matrix.package.name }}
run: npx lerna exec --scope $TEST_PACKAGE yarn test
- name: Check coverage report existence
id: check-report
env:
PACKAGE_PATH: ${{ matrix.package.path }}
run: |
if [ -f ./amplify-js/$PACKAGE_PATH/coverage/coverage-final.json ]; then
echo "SHOULD_UPLOAD_REPORT=true" >> $GITHUB_OUTPUT;
fi
- name: Get coverage report flag
if: steps.check-report.outputs.SHOULD_UPLOAD_REPORT == 'true'
env:
PACKAGE_PATH: ${{ matrix.package.path }}
id: split-path
run: echo "REPORT_FLAG=${PACKAGE_PATH##*/}" >> $GITHUB_OUTPUT
- name: Upload coverage report
if: steps.check-report.outputs.SHOULD_UPLOAD_REPORT == 'true'
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
files: ./amplify-js/${{ matrix.package.path }}/coverage/coverage-final.json
flags: ${{ steps.split-path.outputs.REPORT_FLAG }}
Loading