Skip to content

Test Converters

Test Converters #70

name: frameworkTesting
run-name: Test Converters
on:
push:
branches:
- main
- feature/*
paths:
- "src/**"
pull_request:
branches:
- main
paths:
- "src/**"
- ".github/workflows/**" #remove later
jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm install
- run: npm run test
# - name: Convert code coverage results for summary
# uses: irongut/[email protected]
# with:
# filename: coverage/*.xml
# badge: true
# format: 'markdown'
# output: 'file'
# - name: Add code coverage PR comment
# uses: marocchino/sticky-pull-request-comment@v2
# if: github.event_name == 'pull_request'
# with:
# recreate: true
# path: code-coverage-results.md
# - name: Write to job summary
# run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
- name: Convert code coverage results for badge
uses: irongut/[email protected]
with:
filename: coverage/*.xml
hide_branch_rate: true
hide_complexity: true
badge: true
output: 'file'
- name: Extract code coverage badge
run: |
read -r line < code-coverage-results.txt
covBadge=${line/flat/for-the-badge}"
echo $covBadge
cat <<EOF > $HOME/cov.txt
"$covBadge"
EOF
# - name: Create code coverage badge
# uses: schneegans/[email protected]
# with:
# auth: ${{ secrets.GIST_SECRET }}
# gistID: 36ad591681898e170d7fe636cd88b816
# filename: test.json # Use test.svg if you want to use the SVG mode.
# label: Hello
# message: World
# color: orange
# - name: Publish code coverage results
# uses: exuanbo/actions-deploy-gist@v1
# with:
# token: ${{ secrets.GIST_SECRET }}
# gist_id: 36ad591681898e170d7fe636cd88b816
# file_path: code-coverage-results.txt