Skip to content

Commit e2897d7

Browse files
committed
test pyperformance
1 parent 749fc80 commit e2897d7

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

.github/workflows/performance.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ concurrency:
1313

1414
jobs:
1515
perf-import:
16+
if: false
1617
runs-on: ${{ matrix.os }}
1718
strategy:
1819
fail-fast: false
@@ -28,7 +29,7 @@ jobs:
2829
- name: Install dependencies
2930
run: |
3031
python -m pip install --upgrade pip
31-
python -m pip install nox pyperf
32+
python -m pip install nox
3233
- name: Perf importing third-party packages
3334
continue-on-error: true
3435
env:
@@ -70,21 +71,30 @@ jobs:
7071
path: "*.table"
7172

7273
pyperformance:
73-
if: false
7474
runs-on: ${{ matrix.os }}
7575
strategy:
76+
fail-fast: false
7677
matrix:
78+
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
7779
os: [ ubuntu-latest, macOS-latest, windows-latest ]
7880

7981
steps:
8082
- uses: actions/checkout@v4
81-
- uses: s-weigand/setup-conda@v1
83+
- name: Set up Python ${{ matrix.python }}
84+
uses: actions/setup-python@v4
8285
with:
83-
conda-channels: conda-forge
86+
python-version: ${{ matrix.python }}
8487
- name: Install dependencies
8588
run: |
8689
python -m pip install --upgrade pip
87-
python -m pip install nox pyperf
90+
python -m pip install nox
8891
- name: Pyperformance tests against cds
92+
continue-on-error: true
93+
env:
94+
RUN: LONG
8995
run: |
90-
sh scripts/pyperformance.sh
96+
nox -s pyperformance
97+
- uses: actions/upload-artifact@v3
98+
with:
99+
name: pyperformance
100+
path: "*.json"

noxfile.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
import os
55
import platform
6+
import shutil
67
import typing as t
78

89
import nox
@@ -201,7 +202,8 @@ def test_import_third_party_perf(session: nox.Session, package):
201202
ci_session_cleanup()
202203

203204

204-
def _pyperformance(session: nox.Session, pyperformance_cmd=None):
205+
@nox.session(venv_backend='venv')
206+
def pyperformance(session: nox.Session, pyperformance_cmd=None):
205207
session.install(CDS_PYPERFORMANCE)
206208

207209
configs = [
@@ -224,9 +226,9 @@ def _pyperformance(session: nox.Session, pyperformance_cmd=None):
224226
cmd_exc = None
225227
for out, args in configs:
226228
if os.path.exists(out):
227-
session.run('mv', out, out + '.old')
229+
shutil.move(out, out + '.old')
228230
try:
229-
session.run(*(pyperformance_cmd + args), f'--out={out}')
231+
session.run(*(pyperformance_cmd + args), f'--out={repr(out)}')
230232
except CommandFailed as e:
231233
if cmd_exc is None:
232234
cmd_exc = e

0 commit comments

Comments
 (0)