output mocha's test results and coverage report as artifacts
All checks were successful
Server Tests / Mocha – Unit & Utility Tests (push) Successful in 1m12s
Server Tests / Jest – Integration Tests (push) Successful in 1m35s

This commit is contained in:
Devin Major 2026-04-29 13:41:28 -04:00
parent a6d75af447
commit ea46cbeb02

View File

@ -177,14 +177,42 @@ jobs:
# Run all top-level test_*.js files (skips integration/ and satloc/ sub-dirs
# which are covered by the jest-integration job or need live connections).
- name: Run Mocha unit tests (tests/)
# Coverage is aggregated across this run and tests/utils/.
- name: Run Mocha unit tests with coverage
run: |
set -o pipefail
rm -rf .nyc_output coverage/mocha mocha-unit.log
npx nyc \
--silent \
--temp-dir .nyc_output \
npx mocha --exit --timeout 120000 \
--require tests/setup.js \
'tests/test_*.js'
continue-on-error: false
'tests/test_*.js' 2>&1 | tee mocha-unit.log
# Run Mocha tests in tests/utils/
- name: Run Mocha utility tests (tests/utils/)
run: npm run test:utils
continue-on-error: false
npx nyc \
--silent \
--temp-dir .nyc_output \
--no-clean \
npm run test:utils 2>&1 | tee -a mocha-unit.log
npx nyc report \
--temp-dir .nyc_output \
--report-dir coverage/mocha \
--reporter=text \
--reporter=lcov \
--reporter=json-summary | tee -a mocha-unit.log
- name: Upload Mocha results
if: always()
uses: actions/upload-artifact@v3
with:
name: mocha-unit-results
path: Development/server/mocha-unit.log
- name: Upload Mocha coverage
if: always()
uses: actions/upload-artifact@v3
with:
name: mocha-unit-coverage
path: Development/server/coverage/mocha