Skip to content

Commit

Permalink
Benchmark updates (PLC-lang#882)
Browse files Browse the repository at this point in the history
* Rework the benchmarking, still WIP

* Project structure

* Add dry-run check

* Sql support - wip

* Sql support - wip

* SQL Insert done, needs cleanup

* Update metrics to push to sql database, add metrics workflow on each commit

* Remove benchmarks dir reference and use temp dirs instead, also remove the Compiler env

* Use clap for interface, add other aliases

* Fix the metrics, use pic when compiling executables

* Use shell as bash

* Make sure pkg-config is installed for the metrics

* Restore the feature for sqlx

* Remove the apt dependencies

Also add the workspace to safe dirs in git

* Mode the git clone part to the default tasks

* Rename db tables

* Update gitignore, remove benchmarks

---------

Co-authored-by: Volkan Sagcan <[email protected]>
  • Loading branch information
ghaith and volsa authored Jul 6, 2023
1 parent e9a8284 commit 17d040c
Show file tree
Hide file tree
Showing 21 changed files with 2,007 additions and 386 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[alias]
xtask = "run --package xtask --"
metrics = "run --package xtask -- metrics"
metrics-sql = "run --package xtask --features=sql -- metrics"

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Metrics

on:
push:
branches:
- master
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -16,17 +17,20 @@ jobs:
metrics:
name: Metrics
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: master
- uses: actions/checkout@v3

- name: Collect metrics
- name: Collect metrics (Git)
shell: bash
if: github.ref_name == 'master'
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$IMAGE_VERSION
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker pull $IMAGE_ID
./scripts/build.sh --metrics --container --container-name=$IMAGE_ID --ci
cargo metrics --reporter=git
- name: Collect metrics (Local)
shell: bash
if: github.ref_name != 'master'
run: |
git config --global --add safe.directory /__w/rusty/rusty &&
cargo metrics
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
*.o
*.bc
*.a
*.elf
*.elf
Loading

0 comments on commit 17d040c

Please sign in to comment.