-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (59 loc) · 1.92 KB
/
benchmarks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Benchmarks
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
RUST_BACKTRACE: 1
jobs:
benchmarks:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# we only use macos for fast testing
os: [macos-latest]
python-version: ['3.11']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
env:
BIN: ${{ matrix.os == 'macos-latest' && 'Scripts' || 'bin' }}
run: |
python -m venv venv
- name: Set up Rust
run: rustup show
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install Plugin
run: |
brew install jpeg-xl
export DEP_JXL_LIB=$(brew --prefix jpeg-xl)'/lib'
export DEP_BROTLI_LIB=$(brew --prefix brotli)'/lib'
export DEP_HWY_LIB=$(brew --prefix highway)'/lib'
source venv/bin/activate
pip install maturin
maturin develop --features dynamic
- name: Run benchmarks scripts
run: |
source venv/bin/activate
python benchmarks/benchmarks_encode.py -i test/images/bench.png -o benchmarks-results-${{ matrix.python-version }}.json
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: benchmarks-results-${{ matrix.python-version }}
path: benchmarks-results-${{ matrix.python-version }}.json
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}