Skip to content
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
83 changes: 20 additions & 63 deletions .github/workflows/combined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,76 +146,33 @@ jobs:
fi
fi

generate-markdown-report:
name: Generate Markdown Test Report
deploy-test-report:
name: Deploy Test Report to GitHub Pages
runs-on: ubuntu-latest
needs: test
if: always()

if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
contents: read
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Download test artifacts
- name: Download test report artifact
uses: actions/download-artifact@v4
with:
pattern: test-results-*
merge-multiple: false
path: test-artifacts

- name: Prepare test data for report
run: |
# Prefer 20.x artifacts if available
if [ -d "test-artifacts/test-results-20.x" ]; then
ARTIFACT_DIR="test-artifacts/test-results-20.x"
elif [ -d "test-artifacts/test-results-18.x" ]; then
ARTIFACT_DIR="test-artifacts/test-results-18.x"
else
# Fallback: first directory inside test-artifacts
ARTIFACT_DIR=$(find test-artifacts -maxdepth 1 -type d ! -path "test-artifacts" | head -1 || echo "")
fi
pattern: test-results-20.x
path: report-artifacts

echo "Using artifact directory: $ARTIFACT_DIR"

if [ -n "$ARTIFACT_DIR" ] && [ -d "$ARTIFACT_DIR" ]; then
if [ -f "$ARTIFACT_DIR/test-results.xml" ]; then
cp "$ARTIFACT_DIR/test-results.xml" test-results.xml
fi

if [ -d "$ARTIFACT_DIR/coverage" ]; then
rm -rf coverage
cp -R "$ARTIFACT_DIR/coverage" coverage
fi
else
echo "No suitable artifact directory found for test report generation."
fi

- name: Generate Markdown test report
run: npm run test:report
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: report-artifacts/test-results-20.x/test-report

- name: Commit and push Markdown report
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add tests/README.md
if git diff --cached --quiet; then
echo "No changes to commit for tests/README.md"
exit 0
fi
git commit -m "Update tests/README.md [skip ci]"
git push
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

build:
name: Build
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"xml2js": "^0.6.2",
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"xml2js": "^0.6.2"
"typescript": "^5.4.5"
},
"dependencies": {
"node-forge": "^1.3.1"
Expand Down
Loading