Git Product home page Git Product logo

html-trend-report-action's Introduction

html-trend-report-action

Publish html trend reports per branch (type: node20)

Implementation of Jenkins Plot and HTML Publisher.

See examples:

Compatible with allure-report-branch-action. See Allure History List

Usage

  1. Enable Pages in your repository settings. Github Pages

  2. In your workflow yaml

permissions:
  contents: write

steps:
  - name: Checkout gh-pages
    uses: actions/checkout@v3
    if: always()
    continue-on-error: true
    with:
      ref: gh-pages # branch name
      path: gh-pages-dir # checkout path

  - name: HTML Report
    if: always()
    uses: mgrybyk-org/html-trend-report-action@v1
    id: html-report # used in comment to PR
    with:
      report_id: 'Jacoco Report'
      gh_pages: 'gh-pages-dir'
      report_dir: 'test/html' # provide path to folder containing the html report

  - name: Chart Report (single csv)
    if: ${{ always() }}
    uses: mgrybyk-org/html-trend-report-action@v1
    id: chart-report # used in comment to PR
    with:
      report_id: 'Trend Report'
      gh_pages: 'gh-pages-dir'
      report_dir: 'test/data.csv' # provide path to csv file
      list_dirs: ${{ github.ref == 'refs/heads/main' }}
      report_type: csv

  - name: Chart Report (multiple csv)
    if: ${{ always() }}
    uses: mgrybyk-org/html-trend-report-action@v1
    id: chart-report # used in comment to PR
    with:
      report_id: 'Trend Report'
      gh_pages: 'gh-pages-dir'
      report_dir: 'test/csv' # provide path to folder containing csv files
      report_type: csv

  - name: Git Commit and Push Action
    uses: mgrybyk-org/git-commit-pull-push-action@v1
    if: always()
    with:
      repository: gh-pages-dir
      branch: gh-pages
      pull_args: --rebase -X ours

Adding PR Comment

Make sure to set id in mgrybyk-org/html-trend-report-action step.

permissions:
  # required by https://github.com/thollander/actions-comment-pull-request
  pull-requests: write

steps:
  # After publishing to gh-pages
  - name: Comment PR with Allure Report link
    if: ${{ always() && github.event_name == 'pull_request' && (steps.allure.outputs.report_url || steps.html-1.outputs.report_url || steps.chart-2.outputs.report_url) }}
    continue-on-error: true
    uses: thollander/actions-comment-pull-request@v2
    with:
      message: |
        [Report](${{ steps.html-report.outputs.report_url }})
      comment_tag: test_reports
      mode: recreate

Examples Repos

TODO

API

Please see action.yml

Troubleshooting

Issues on push to gh-pages

Log ! [rejected] HEAD -> gh-pages (non-fast-forward)

Do not run your workflow concurrently per PR or branch!

# Allow only one job per PR or branch
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true # true to cancel jobs in progress, set to false otherwise

Credits

## Planned features

  • cleanup data.json file per report. Raise an issue if you're interested!

html-trend-report-action's People

Contributors

mgrybyk avatar

Stargazers

 avatar Mike Grybyk avatar

Watchers

 avatar

html-trend-report-action's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.