Cache runs other than jsontoolkit #148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_GEMFILE: ${{ github.workspace }}/implementations/json_schemer/Gemfile | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache runs | |
uses: actions/cache@v4 | |
with: | |
path: dist/results/ | |
key: ${{ runner.os }}-runs | |
- name: Update modified time of output for make | |
continue-on-error: true | |
run: | | |
find dist/results -print0 | xargs -0 touch -c | |
for f in dist/results/*; do touch "implementations/$(basename $f)/.dockertimestamp"; done | |
- name: DEBUG | |
run: | | |
for f in dist/results/*; do | |
echo "$f"; cat "$f"; echo "------------------------" | |
done | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12.5' | |
- name: Install uv | |
run: pipx install uv | |
- name: Run benchmarks | |
continue-on-error: true | |
run: make dist/report.csv | |
- run: cat dist/report.csv | |
- name: Process CSV | |
run: python .github/csv_min.py > dist/report-min.csv | |
- name: Read CSV | |
id: csv | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: dist/report-min.csv | |
- name: Create MD | |
uses: petems/csv-to-md-table-action@master | |
id: csv-table-output | |
with: | |
csvinput: ${{ steps.csv.outputs.content }} | |
- name: Output summary | |
env: | |
MARKDOWN_TABLE: ${{ steps.csv-table-output.outputs.markdown-table }} | |
run: echo "$MARKDOWN_TABLE" >> $GITHUB_STEP_SUMMARY | |
- run: make plots | |
- name: Upload plots | |
id: imgur | |
uses: devicons/[email protected] | |
with: | |
path: dist/results/plots/*.png | |
client_id: ${{secrets.IMGUR_CLIENT_ID}} | |
- name: Add plots to summary | |
env: | |
IMG_URLS: ${{ steps.imgur.outputs.imgur_urls }} | |
run: python .github/plot_markdown.py >> $GITHUB_STEP_SUMMARY | |
- name: Clean up jsontoolkit runs to avoid caching | |
run: rm -r dist/results/{jsontoolkit,plots} |