Generate a Solidity Code Metrics HTML-Report for your Project.
Include it in your GitHub Actions file after a checkout.
- name: 📊 Crunch Numbers
uses: tintinweb/solidity-metrics-action@v1
id: metrics
with:
target: '{,**/}*.sol'
Generates a HTML metrics report in the workspace root. The path can be accessed via ${{ steps.metrics.outputs.report }}
(by default: __metrics.html
).
id: <metrics>
allows us to access the generated report with ${{ steps.<metrics>.outputs.report }}
).${{ steps.<metrics>.outputs.report }}
as an artifact to the jobThe target
argument takes a single glob to select input files. By default it will try to load any *.sol
file in the root or sub-paths (i.e. {,**/}*.sol
).
name: Metrics
on:
pull_request:
branches: [ master ]
jobs:
metrics:
name: 📊 Code Metrics
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/checkout@v3
- name: 📊 Crunch Numbers
uses: tintinweb/solidity-metrics-action@v1
id: metrics
with:
target: '{,**/}*.sol'
- uses: actions/upload-artifact@v3
with:
name: metrics.html
path: ${{ steps.metrics.outputs.report }}