Skip to content

release: v1.0.0

release: v1.0.0 #47

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
- run: bun install --frozen-lockfile
- name: Record test start time
id: test_start
run: echo "value=$(date +%s%3N)" >> "$GITHUB_OUTPUT"
- name: Run tests
run: bun test --reporter=junit --reporter-outfile=test-report.xml
- name: Record test stop time
id: test_stop
if: always()
run: echo "value=$(date +%s%3N)" >> "$GITHUB_OUTPUT"
- name: Convert test report to CTRF
if: always()
run: |
bunx junit-to-ctrf@0.0.14 test-report.xml -o ctrf/ctrf-report.json -t bun
jq '.results.summary.start = ${{ steps.test_start.outputs.value }} | .results.summary.stop = ${{ steps.test_stop.outputs.value }}' \
ctrf/ctrf-report.json > ctrf/ctrf-report.tmp.json
mv ctrf/ctrf-report.tmp.json ctrf/ctrf-report.json
- name: Publish test report
if: always() && github.event_name == 'pull_request'
uses: ctrf-io/github-test-reporter@e500b992f936420eb633c91644cf10d4d71df700 # v1.1.0
with:
report-path: ctrf/ctrf-report.json
custom-report: true
template-path: .github/ctrf-pr-report.hbs
pull-request: true
overwrite-comment: true
comment-tag: bun-test-report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}