Automatically publish scheduled RTLMeter results (#6074)
Update RTLMeter workflow to automatically push the performance numbers from scheduled (nightly) runs to verilator/verilator-rtlmeter-results
This commit is contained in:
parent
d9534ec626
commit
07394fcafa
|
@ -16,10 +16,17 @@ on:
|
||||||
description: "Compiler to use: 'gcc' or 'clang'"
|
description: "Compiler to use: 'gcc' or 'clang'"
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
# Note: The combination of 'cases' and 'run-name' must be unique for all
|
||||||
|
# invocations of this workflow within a run of the parent workflow.
|
||||||
|
# These two are used together to generate a unique results file name.
|
||||||
cases:
|
cases:
|
||||||
description: "RTLMeter cases to run"
|
description: "RTLMeter cases to run"
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
run-name:
|
||||||
|
description: "Run name (identifier) to add to collated results"
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
compileArgs:
|
compileArgs:
|
||||||
description: "Additional Verilator command line arguments"
|
description: "Additional Verilator command line arguments"
|
||||||
type: string
|
type: string
|
||||||
|
@ -93,10 +100,10 @@ jobs:
|
||||||
id: results
|
id: results
|
||||||
working-directory: rtlmeter
|
working-directory: rtlmeter
|
||||||
run: |
|
run: |
|
||||||
# 'inputs.cases' has special characters, use its md5sum as unique id
|
# Use 'inputs.cases' and 'inputs.run-name' to generate a unique file name
|
||||||
hash=$(md5sum <<< '${{ inputs.cases }}' | awk '{print $1}')
|
hash=$(md5sum <<< '${{ inputs.cases }} ${{ inputs.run-name }}' | awk '{print $1}')
|
||||||
echo "hash=${hash}" >> $GITHUB_OUTPUT
|
echo "hash=${hash}" >> $GITHUB_OUTPUT
|
||||||
./rtlmeter collate > ../results-${hash}.json
|
./rtlmeter collate --runName "${{ inputs.run-name }}" > ../results-${hash}.json
|
||||||
|
|
||||||
- name: Report results
|
- name: Report results
|
||||||
working-directory: rtlmeter
|
working-directory: rtlmeter
|
||||||
|
@ -107,7 +114,7 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: results-${{ steps.results.outputs.hash }}.json
|
path: results-${{ steps.results.outputs.hash }}.json
|
||||||
name: rtlmeter-results-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ steps.results.outputs.hash }}
|
name: rtlmeter-results-${{ steps.results.outputs.hash }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
retention-days: 2
|
retention-days: 2
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ jobs:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
cc: gcc
|
cc: gcc
|
||||||
cases: ${{ matrix.cases }}
|
cases: ${{ matrix.cases }}
|
||||||
|
run-name: "gcc"
|
||||||
compileArgs: ""
|
compileArgs: ""
|
||||||
executeArgs: ""
|
executeArgs: ""
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -88,6 +89,7 @@ jobs:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
cc: clang
|
cc: clang
|
||||||
cases: ${{ matrix.cases }}
|
cases: ${{ matrix.cases }}
|
||||||
|
run-name: "clang --threads 4"
|
||||||
compileArgs: "--threads 4"
|
compileArgs: "--threads 4"
|
||||||
executeArgs: ""
|
executeArgs: ""
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -128,38 +130,78 @@ jobs:
|
||||||
if: ${{ (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) && !cancelled() }}
|
if: ${{ (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) && !cancelled() }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Download all GCC results
|
- name: Download all results
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: rtlmeter-results-ubuntu-24.04-gcc-*
|
pattern: rtlmeter-results-*
|
||||||
path: all-results-gcc-${{ github.run_id }}
|
path: all-results-${{ github.run_id }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Download all Clang results
|
- name: Tar up all results into single archive
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: rtlmeter-results-ubuntu-24.04-clang-*
|
|
||||||
path: all-results-clang-${{ github.run_id }}
|
|
||||||
merge-multiple: true
|
|
||||||
- name: Tar up results
|
|
||||||
run: |
|
run: |
|
||||||
# Ensure combined result directories exists in case of no results
|
# Ensure combined result directory exists in case of no results
|
||||||
mkdir -p all-results-gcc-${{ github.run_id }}
|
mkdir -p all-results-${{ github.run_id }}
|
||||||
mkdir -p all-results-clang-${{ github.run_id }}
|
ls -la all-results-${{ github.run_id }}
|
||||||
ls -la all-results*
|
# Tar up the results directory
|
||||||
# Tar up each directory
|
tar --posix -c -z -f all-results-${{ github.run_id }}.tar.gz all-results-${{ github.run_id }}
|
||||||
tar --posix -c -z -f all-results-gcc-${{ github.run_id }}.tar.gz all-results-gcc-${{ github.run_id }}
|
- name: Upload combined results
|
||||||
tar --posix -c -z -f all-results-clang-${{ github.run_id }}.tar.gz all-results-clang-${{ github.run_id }}
|
|
||||||
- name: Upload combined GCC results
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: all-results-gcc-${{ github.run_id }}.tar.gz
|
path: all-results-${{ github.run_id }}.tar.gz
|
||||||
name: "all-results-gcc"
|
name: all-results
|
||||||
overwrite: true
|
overwrite: true
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
- name: Upload combined Clang results
|
|
||||||
uses: actions/upload-artifact@v4
|
publish-results:
|
||||||
|
name: Publish results to verilator/verilator-rtlmeter-results
|
||||||
|
needs: combine-results
|
||||||
|
# Only run on scheduled builds on the main repository. We also restrict
|
||||||
|
# the publishing to run only on the first run_attempt. This is required
|
||||||
|
# to prevent multiple uploads the same day (if rerunning), as the
|
||||||
|
# dashboard UI currently assumes there is only one data point per
|
||||||
|
# calendar day. Results from reruns can be imported manually if needed.
|
||||||
|
if: ${{ github.event_name == 'schedule' && github.repository == 'verilator/verilator' && github.run_attempt == 1 && contains(needs.*.result, 'success') && !cancelled() }}
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Download combined results
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: all-results-clang-${{ github.run_id }}.tar.gz
|
name: all-results
|
||||||
name: "all-results-clang"
|
path: results
|
||||||
overwrite: true
|
- name: Extract combined results
|
||||||
retention-days: 30
|
working-directory: results
|
||||||
|
run: |
|
||||||
|
tar xzfv all-results-${{ github.run_id }}.tar.gz
|
||||||
|
ls -la
|
||||||
|
# Pushing to verilator/verilator-rtlmeter-results requires elevated permissions
|
||||||
|
- name: Generate access token
|
||||||
|
id: generate-token
|
||||||
|
uses: actions/create-github-app-token@v2.0.6
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.RTLMETER_RESULTS_CI_APP_ID }}
|
||||||
|
private-key: ${{ secrets.RTLMETER_RESULTS_CI_APP_PRIVATE_KEY }}
|
||||||
|
owner: verilator
|
||||||
|
repositories: verilator-rtlmeter-results
|
||||||
|
- name: Checkout verilator-rtlmeter-results
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: "verilator/verilator-rtlmeter-results"
|
||||||
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
path: verilator-rtlmeter-results
|
||||||
|
- name: Import results
|
||||||
|
id: import-results
|
||||||
|
working-directory: verilator-rtlmeter-results
|
||||||
|
run: |
|
||||||
|
for f in $(find ../results -name "*.json"); do \
|
||||||
|
echo "Importing $f"; \
|
||||||
|
./bin/add-rtlmeter-result $f; \
|
||||||
|
done
|
||||||
|
test -z "$(git status --porcelain)" || echo "valid=1" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: Push to verilator-rtlmeter-results
|
||||||
|
if: ${{ steps.import-results.outputs.valid }}
|
||||||
|
working-directory: verilator-rtlmeter-results
|
||||||
|
run: |
|
||||||
|
git config --global user.email "action@example.com"
|
||||||
|
git config --global user.name "github action"
|
||||||
|
git add .
|
||||||
|
git commit -m "Verilator CI: Results of 'RTLMeter' workflow run #${{ github.run_number }}"
|
||||||
|
git push origin
|
||||||
|
|
Loading…
Reference in New Issue