Skip to content

Commit

Permalink
ci: fix paths in coverage files
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Oct 9, 2024
1 parent bca0099 commit 6ff8c8f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ jobs:
# Create the directories in case they don't exist
mkdir -p .tmp/coverage .tmp/junit
# Copy the files to the respective folder, named after the project.
yarn workspaces foreach -Apv --exclude . exec \
bash -c \
'if [ -f "coverage/clover.xml" ]; then cp -f "coverage/clover.xml" "../../../../.tmp/coverage/$(basename $PWD).xml"; fi; \
'if [ -f "coverage/clover.xml" ]; then \
# Make file paths relative
sed -i "" "s|'$PWD'/||g" "coverage/clover.xml"; \
cp -f "coverage/clover.xml" "'$PWD'/.tmp/coverage/$(basename $PWD).xml"; \
fi; \
if [[ -f "junit.xml" && -s "junit.xml" ]]; then \
sed -i "s|<testsuites name=\".*\">|<testsuites name=\"$npm_package_name\">|" "junit.xml"; \
cp -f "junit.xml" "../../../../.tmp/junit/$(basename $PWD).xml"; \
# Set the testsuites name to the package name
sed -i "" "s|<testsuites name=\".*\">|<testsuites name=\"$npm_package_name\">|" "junit.xml"; \
cp -f "junit.xml" "'$PWD'/.tmp/junit/$(basename $PWD).xml"; \
fi'
# Make the coverage paths relative before uploading
find .tmp/coverage -type f -name '*.xml' -exec sed -i 's|'"$PWD"'/||g' {} \;
- uses: myparcelnl/actions/codecov-coverage@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit 6ff8c8f

Please sign in to comment.