Benchmarks #110
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |