From f79b6c3624a909033d06eda54a086e6fe8dbcd2d Mon Sep 17 00:00:00 2001 From: drunkendog Date: Mon, 25 Sep 2023 20:58:33 +0100 Subject: [PATCH] Add throughput badge --- .gitea/workflows/benchmark.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/benchmark.yaml b/.gitea/workflows/benchmark.yaml index 7db2f33..b725516 100644 --- a/.gitea/workflows/benchmark.yaml +++ b/.gitea/workflows/benchmark.yaml @@ -24,4 +24,12 @@ jobs: - name: Run throughput benchmark run: | cd benchmark/ - bash benchmark-throughput.sh python3 ../../run-tests.py \ No newline at end of file + BENCHMARK_THROUGHPUT=$(bash benchmark-throughput.sh python3 ../../run-tests.py) + 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' \ + "https://badgeapi.docker.162536.xyz/set_badge/?repo=marmoset-test-cases&branch=main&action=throughput&new_badge=Throughput-$(bc <<< \"scale=2; $BENCHMARK_THROUGHPUT / 1024\") kB/s-blue" \ + -H 'accept: application/json' \ + -H 'X-API-Key: ${{ secrets.BADGE_API_KEY }}' \ No newline at end of file