Skip to content

feature(pkg): re-implement fetching with curl (#8944) #5

feature(pkg): re-implement fetching with curl (#8944)

feature(pkg): re-implement fetching with curl (#8944) #5

Workflow file for this run

name: Build time benchmarks
# Do not run this workflow on pull request since this workflow has permission to modify contents.
on:
push:
branches:
- main
- bench/fix-melange-bench-grep
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 4.14.x
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-depext: false
# dune doesn't have any additional dependencies so we can build it right
# away this makes it possible to see build errors as soon as possible
- run: opam exec -- make _boot/dune.exe
- name: Install deps on Unix
run: |
opam install . --deps-only --with-test
opam exec -- make dev-deps
# Install hyperfine
wget https://github.com/sharkdp/hyperfine/releases/download/v1.14.0/hyperfine_1.14.0_amd64.deb
sudo dpkg -i hyperfine_1.14.0_amd64.deb
- name: Create watch synthetic benchmark
working-directory: bench
run: opam exec -- ../_boot/dune.exe exec ./gen_synthetic_dune_watch.exe -- synthetic-watch
- name: Run synthetic watch benchmark
working-directory: bench/synthetic-watch
run: ../gen-benchmark.sh 'opam exec -- ../run-synthetic-dune-watch.sh ../../_boot/dune.exe' 'opam exec -- ../../_boot/dune.exe build @all' 'synthetic watch build time (warm, ${{ runner.os }})' > synthetic-benchmark-result.json
- name: Print synthetic watch benchmark results
working-directory: bench/synthetic-watch
run: |
cat bench.json
cat synthetic-benchmark-result.json
- name: Store synthetic watch benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Synthetic Watch Benchmark
tool: "customSmallerIsBetter"
output-file-path: bench/synthetic-watch/synthetic-benchmark-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Ratio indicating how worse the current benchmark result is.
# 175% means if last build took 40s and current takes >70s, it will trigger an alert
alert-threshold: "175%"
fail-on-alert: true
# Enable alert commit comment
comment-on-alert: true
# Mention @jchavarri in the commit comment
alert-comment-cc-users: '@jchavarri'
- name: Clone pupilfirst repo
run: git clone https://github.com/jchavarri/pupilfirst.git
- name: Checkout dune-melange branch
working-directory: pupilfirst
run: git checkout b6fe6fa27814336b9e92f965449f3e010e148c4b
- name: Install all deps
working-directory: pupilfirst
run: |
yarn install
opam install -y reason melange reactjs-jsx-ppx rescript-syntax
opam pin add -y graphql_ppx https://github.com/jchavarri/graphql-ppx.git\#2598910886f1d2d3869406ae7eb787341d8dce6b
- name: Run pupilfirst benchmark
working-directory: pupilfirst
run: ../bench/gen-benchmark.sh 'opam exec -- ../_boot/dune.exe build --root=. @main' 'opam exec -- ../_boot/dune.exe clean --root=.' 'pupilfirst build time (${{ runner.os }})' > melange-benchmark-result.json
- name: Print pupilfirst benchmark results
working-directory: pupilfirst
run: |
cat bench.json
cat melange-benchmark-result.json
- name: Store melange benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Melange Benchmark
tool: "customSmallerIsBetter"
output-file-path: pupilfirst/melange-benchmark-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Ratio indicating how worse the current benchmark result is.
# 150% means if last build took 40s and current takes >60s, it will trigger an alert
alert-threshold: "150%"
fail-on-alert: true
# Enable alert commit comment
comment-on-alert: true
# Mention @jchavarri in the commit comment
alert-comment-cc-users: '@jchavarri'
- name: Create synthetic benchmark
working-directory: bench
run: opam exec -- ../_boot/dune.exe exec ./gen_synthetic.exe -- -n 2000 synthetic
- name: Run cold synthetic benchmark
working-directory: bench/synthetic
run: ../gen-benchmark.sh 'opam exec -- ../../_boot/dune.exe build @all' 'opam exec -- ../../_boot/dune.exe clean' 'synthetic build time (cold, ${{ runner.os }})' > synthetic-benchmark-result.json
- name: Print cold synthetic benchmark results
working-directory: bench/synthetic
run: |
cat bench.json
cat synthetic-benchmark-result.json
- name: Store cold synthetic benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Synthetic Benchmark
tool: "customSmallerIsBetter"
output-file-path: bench/synthetic/synthetic-benchmark-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Ratio indicating how worse the current benchmark result is.
# 150% means if last build took 40s and current takes >60s, it will trigger an alert
alert-threshold: "150%"
fail-on-alert: true
# Enable alert commit comment
comment-on-alert: true
# Mention @jchavarri in the commit comment
alert-comment-cc-users: '@jchavarri'
- name: Run warm synthetic benchmark
working-directory: bench/synthetic
run: ../gen-benchmark.sh 'opam exec -- ../../_boot/dune.exe build @all' 'true' 'synthetic build time (warm, ${{ runner.os }})' > synthetic-benchmark-result.json
- name: Print warm synthetic benchmark results
working-directory: bench/synthetic
run: |
cat bench.json
cat synthetic-benchmark-result.json
- name: Store warm synthetic benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Synthetic Benchmark
tool: "customSmallerIsBetter"
output-file-path: bench/synthetic/synthetic-benchmark-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Ratio indicating how worse the current benchmark result is.
# 150% means if last build took 40s and current takes >60s, it will trigger an alert
alert-threshold: "150%"
fail-on-alert: true
# Enable alert commit comment
comment-on-alert: true
# Mention @jchavarri in the commit comment
alert-comment-cc-users: '@jchavarri'