Skip to content

Commit

Permalink
test pyperformance
Browse files Browse the repository at this point in the history
  • Loading branch information
oraluben committed Oct 24, 2023
1 parent 749fc80 commit 999fc55
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

jobs:
perf-import:
if: false
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -28,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox pyperf
python -m pip install nox
- name: Perf importing third-party packages
continue-on-error: true
env:
Expand Down Expand Up @@ -73,18 +74,28 @@ jobs:
if: false
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
os: [ ubuntu-latest, macOS-latest, windows-latest ]

steps:
- uses: actions/checkout@v4
- uses: s-weigand/setup-conda@v1
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
conda-channels: conda-forge
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox pyperf
python -m pip install nox
- name: Pyperformance tests against cds
continue-on-error: true
env:
RUN: LONG
run: |
sh scripts/pyperformance.sh
nox -s pyperformance
- uses: actions/upload-artifact@v3
with:
name: pyperformance
path: "*.json"
8 changes: 5 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import os
import platform
import shutil
import typing as t

import nox
Expand Down Expand Up @@ -201,7 +202,8 @@ def test_import_third_party_perf(session: nox.Session, package):
ci_session_cleanup()


def _pyperformance(session: nox.Session, pyperformance_cmd=None):
@nox.session(venv_backend='venv')
def pyperformance(session: nox.Session, pyperformance_cmd=None):
session.install(CDS_PYPERFORMANCE)

configs = [
Expand All @@ -224,9 +226,9 @@ def _pyperformance(session: nox.Session, pyperformance_cmd=None):
cmd_exc = None
for out, args in configs:
if os.path.exists(out):
session.run('mv', out, out + '.old')
shutil.move(out, out + '.old')
try:
session.run(*(pyperformance_cmd + args), f'--out={out}')
session.run(*(pyperformance_cmd + args), f'--out={repr(out)}')
except CommandFailed as e:
if cmd_exc is None:
cmd_exc = e
Expand Down

0 comments on commit 999fc55

Please sign in to comment.