better deploys
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 2m28s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 2m28s
This commit is contained in:
@@ -107,15 +107,23 @@ jobs:
|
||||
if: always() # This step runs even if the previous test step failed.
|
||||
run: |
|
||||
echo "--- Merging Coverage Reports and Displaying Text Summary ---"
|
||||
# Step 1: Merge the coverage data from both unit and integration test runs
|
||||
# into a single file in the .coverage directory.
|
||||
npx nyc merge .coverage/integration .coverage/unit
|
||||
|
||||
# Add logging to verify that the source coverage files exist before merging.
|
||||
echo "Checking for source coverage files..."
|
||||
ls -l .coverage/unit/coverage-final.json
|
||||
ls -l .coverage/integration/coverage-final.json
|
||||
|
||||
# Step 1: Explicitly merge the two coverage-final.json files into a single output file.
|
||||
# This is more robust than letting nyc guess the files.
|
||||
echo "Merging coverage data..."
|
||||
npx nyc merge .coverage/merged .coverage/unit/coverage-final.json .coverage/integration/coverage-final.json
|
||||
# Move the merged file to the root of the .coverage directory for the report step.
|
||||
mv .coverage/merged/coverage.json .coverage/coverage.json
|
||||
|
||||
# Step 2: Generate the text summary from the merged data and print it to the console.
|
||||
npx nyc report --reporter=text
|
||||
# Step 3: Generate the final HTML report from the same merged data for archiving.
|
||||
npx nyc report --reporter=html --report-dir .coverage/
|
||||
# Step 2: Generate the text summary and HTML report from the single, merged coverage file.
|
||||
echo "Generating reports from merged data..."
|
||||
npx nyc report --reporter=text --reporter=html --report-dir .coverage/
|
||||
echo "✅ Coverage reports generated successfully."
|
||||
|
||||
- name: Archive Code Coverage Report
|
||||
# This action saves the generated HTML coverage report as a downloadable artifact.
|
||||
|
||||
Reference in New Issue
Block a user