-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (106 loc) · 3.16 KB
/
benchmark.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#
# JBZoo Toolbox - Csv-Blueprint.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @see https://github.com/JBZoo/Csv-Blueprint
#
name: Benchmarks
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
branch:
description: 'Branch Name'
required: false
jobs:
docker-benchmark:
name: Docker
runs-on: ubuntu-latest
strategy:
matrix:
version: [ latest, local ]
columns: [ 1, 5, 10, 20 ]
env:
BENCH_COLS: ${{ matrix.columns }}
DOCKER_IMAGE: jbzoo/csv-blueprint:${{ matrix.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
# We need it to build benchmark tool. See ./tests/Benchmarks
- name: Build project
run: make build --no-print-directory
- name: Build local image
if: matrix.version == 'local'
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.DOCKER_IMAGE }}
- name: Pull latest image
if: matrix.version == 'latest'
run: docker pull ${{ env.DOCKER_IMAGE }}
- name: 🔥 Benchmark 🔥
run: make bench-create-csv bench-docker --no-print-directory
# No reason to use Phar anymore. Docker is much better and faster.
# Keep it here just for quick benchmarking on demand.
#
# php-benchmark:
# name: Phar
# runs-on: ubuntu-latest
# strategy:
# matrix:
# version: [ latest, local ]
# columns: [ 1, 5, 10, 20 ]
# env:
# BENCH_COLS: ${{ matrix.columns }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# ref: ${{ github.event.inputs.branch || github.ref }}
#
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
#
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# coverage: none
# ini-values: opcache.enable_cli=1, opcache.jit=1255
#
# - name: Build local Phar file
# if: matrix.version == 'local'
# run: |
# make build-prod build-phar-file --no-print-directory
# ./build/csv-blueprint.phar
#
# - name: Download latest Phar file
# if: matrix.version == 'latest'
# run: |
# wget https://github.com/JBZoo/Csv-Blueprint/releases/latest/download/csv-blueprint.phar -O ./build/csv-blueprint.phar
# chmod +x ./build/csv-blueprint.phar
# ./build/csv-blueprint.phar
#
# # We need it to build benchmark tool. See ./tests/Benchmarks
# - name: Build project
# run: make build --no-print-directory
#
# - name: 🔥 Benchmark 🔥
# run: make bench-create-csv bench-phar --no-print-directory