Skip to content

🔧 Implement precompiled Handlebars template system #33

🔧 Implement precompiled Handlebars template system

🔧 Implement precompiled Handlebars template system #33

Workflow file for this run

name: 'Test GitHub Action'
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
permissions:
contents: write
pages: write
id-token: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests with coverage
run: npm test -- --coverage
- name: Build and package
run: npm run all
- name: Test action with real reports
uses: ./
id: test-action
with:
reports-path: './build'
output-file: './index.html'
file-filter: ''
- name: Check outputs
run: |
echo "Generated index: ${{ steps.test-action.outputs.index-path }}"
echo "Files found: ${{ steps.test-action.outputs.file-count }}"
echo "HTML files: ${{ steps.test-action.outputs.html-files }}"
# Check that the index file was created
if [ ! -f "${{ steps.test-action.outputs.index-path }}" ]; then
echo "Error: Index file was not created"
exit 1
fi
# Check that files were found
if [ "${{ steps.test-action.outputs.file-count }}" -eq "0" ]; then
echo "Error: No HTML files were found"
exit 1
fi
echo "✅ GitHub Pages Quick Index action test passed!"
- name: Upload test reports and index
uses: actions/upload-artifact@v4
with:
name: test-reports-with-index
path: |
build/
index.html
retention-days: 30
- name: Prepare GitHub Pages content
if: github.ref == 'refs/heads/main'
run: |
mkdir -p gh-pages-content
cp -r build/ gh-pages-content/
cp index.html gh-pages-content/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages-content
publish_branch: gh-pages
commit_message: 'Deploy test reports and index to GitHub Pages'