Skip to content

Commit

Permalink
tests: run sharing benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed May 4, 2023
1 parent 85ad03b commit 1df0723
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Benchmarks

on:
push:
branches: [main]
pull_request:
schedule:
- cron: '5 1 * * *' # every day at 01:05
workflow_dispatch:
inputs:
dataset:
description: "Dataset Size"
required: false
default: "small"
type: choice
options:
- tiny
- small
- large
- mnist

env:
DVC_TEST: "true"
FORCE_COLOR: "1"
DATASET: ${{ github.event.inputs.dataset || ( github.event_name == 'schedule' && 'mnist' || 'small' ) }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
bench:
timeout-minutes: 45
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
pyv: ["3.10"]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyv }}
cache: 'pip'
cache-dependency-path: setup.cfg

- name: install
run: |
pip install --upgrade pip wheel
pip install -e ".[tests]"
pip install "dvc[testing] @ git+https://github.com/iterative/dvc"
- name: run benchmarks
timeout-minutes: 180
run: pytest --dist no --benchmark-save benchmarks-s3 --benchmark-group-by func --dvc-revs main,2.45.0,2.41.1,2.40.0,2.39.0,2.18.1,2.11.0 --size ${DATASET} dvc_s3/tests/benchmarks.py --dvc-install-deps s3

- name: upload raw results
uses: actions/upload-artifact@v3
with:
name: .benchmarks
path: .benchmarks

- name: create md
if: github.event_name == 'pull_request'
id: get-comment-body
run: |
PY_COLORS=0 py.test-benchmark compare --group-by func --sort name
echo ::set-output name=body::$body
- name: post comment
if: ${{ github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.get-comment-body.outputs.body }}
1 change: 1 addition & 0 deletions dvc_s3/tests/benchmarks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from dvc.testing.benchmarks.cli.stories.use_cases.test_sharing import * # noqa, pylint: disable=wildcard-import,unused-import

0 comments on commit 1df0723

Please sign in to comment.