2023-09-16 21:14:31 +01:00
|
|
|
name: Benchmarks
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
Run-Benchmarks:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
steps:
|
2023-09-25 20:26:17 +01:00
|
|
|
- name: Install dependencies
|
2023-09-16 21:37:29 +01:00
|
|
|
run: |
|
|
|
|
apt-get update -y
|
2023-09-25 20:26:17 +01:00
|
|
|
apt-get install -y time bc
|
2023-09-16 21:14:31 +01:00
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- run: cd ${{ github.workspace }}
|
|
|
|
- name: Run benchmark
|
|
|
|
run: |
|
|
|
|
cd benchmark/
|
2023-09-16 22:06:19 +01:00
|
|
|
bash benchmark.sh python3 ../../run-tests.py
|
2023-09-16 21:14:31 +01:00
|
|
|
- name: Run baseline benchmark
|
|
|
|
run: |
|
|
|
|
cd benchmark/
|
2023-09-18 13:47:56 +01:00
|
|
|
bash benchmark.sh python3 ../run-tests-benchmark-baseline.py
|
|
|
|
- name: Run throughput benchmark
|
|
|
|
run: |
|
|
|
|
cd benchmark/
|
2023-09-25 20:58:33 +01:00
|
|
|
BENCHMARK_THROUGHPUT=$(bash benchmark-throughput.sh python3 ../../run-tests.py)
|
2023-09-26 01:48:05 +01:00
|
|
|
echo "BENCHMARK_THROUGHPUT=$BENCHMARK_THROUGHPUT" >> $GITHUB_ENV
|
2023-09-25 20:58:33 +01:00
|
|
|
echo "$BENCHMARK_THROUGHPUT"
|
|
|
|
- name: Update benchmark badge
|
|
|
|
if: needs.pr-check.outputs.number != 'null' && github.ref == 'refs/heads/main' && success()
|
|
|
|
run: |
|
|
|
|
curl -f -X 'GET' \
|
2023-09-26 01:48:05 +01:00
|
|
|
"https://badgeapi.docker.162536.xyz/set_badge/?repo=marmoset-test-cases&branch=main&action=throughput&new_badge=Throughput-$(echo "scale=2; $BENCHMARK_THROUGHPUT / 1024" | bc) kB/s-blue" \
|
2023-09-25 20:58:33 +01:00
|
|
|
-H 'accept: application/json' \
|
|
|
|
-H 'X-API-Key: ${{ secrets.BADGE_API_KEY }}'
|