mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-01-26 03:04:10 +00:00
67 lines
2.8 KiB
YAML
67 lines
2.8 KiB
YAML
---
|
|
name: CI
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
- name: Set up Go
|
|
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
- name: Install dependencies
|
|
run: go mod tidy
|
|
- name: Setup Node.js for EditorConfig tools
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
|
with:
|
|
node-version: '22'
|
|
- name: Install EditorConfig tools
|
|
run: npm install -g eclint
|
|
- name: Check EditorConfig compliance
|
|
run: eclint check .
|
|
- name: Run unit tests
|
|
run: go test ./...
|
|
- name: Example Action Readme Generation
|
|
run: |
|
|
go run . gen testdata/example-action --output example-README.md
|
|
- name: Comprehensive Documentation Generation
|
|
run: |
|
|
# Create docs directory
|
|
mkdir -p docs
|
|
|
|
# Generate multiple formats for different actions to demonstrate new functionality
|
|
echo "Generating documentation for example-action..."
|
|
go run . gen testdata/example-action/ --output "$PWD/docs/example-action.md"
|
|
go run . gen testdata/example-action/ -f html --output "$PWD/docs/example-action.html"
|
|
go run . gen testdata/example-action/ -f json --output "$PWD/docs/example-action.json"
|
|
|
|
echo "Generating documentation for composite-action..."
|
|
go run . gen testdata/composite-action/ --output "$PWD/docs/composite-action.md"
|
|
go run . gen testdata/composite-action/ -f html --output "$PWD/docs/composite-action.html"
|
|
|
|
# Test single file targeting
|
|
echo "Generating from specific action.yml files..."
|
|
go run . gen testdata/example-action/action.yml --output "$PWD/docs/direct-example.md"
|
|
go run . gen testdata/composite-action/action.yml --output "$PWD/docs/direct-composite.md"
|
|
|
|
# Test recursive generation with different themes
|
|
echo "Testing recursive generation with themes..."
|
|
go run . gen testdata/ --recursive --theme minimal -f html --output "$PWD/docs/all-actions-minimal.html"
|
|
go run . gen testdata/ --recursive --theme professional -f json --output "$PWD/docs/all-actions-professional.json"
|
|
|
|
# Verify files were generated
|
|
echo "Verifying generated documentation files..."
|
|
ls -la docs/
|
|
- name: Upload Generated Documentation
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
if: always()
|
|
with:
|
|
name: generated-documentation
|
|
path: |
|
|
docs/
|
|
testdata/example-action/example-README.md
|
|
retention-days: 7
|