diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9a3fcabf..add96a46a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -112,6 +112,30 @@ jobs: FURY_TOKEN: ${{ secrets.FURY_TOKEN }} GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + Benchmark: + runs-on: "github-001" + if: contains(github.event.pull_request.labels.*.name, 'benchmarks') || github.ref == 'refs/heads/main' + needs: + - Dirty + steps: + - uses: 'actions/checkout@v4' + with: + fetch-depth: 0 + - run: > + earthly + --allow-privileged + ${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }} + ./test/performance+run --args="-benchtime 10s" + - run: > + earthly + --allow-privileged + ${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }} + ./test/performance+generate-graphs + - uses: actions/upload-artifact@v3 + with: + name: graphs + path: test/performance/report + Deploy: runs-on: "ubuntu-latest" if: github.ref == 'refs/heads/main' diff --git a/test/performance/Earthfile b/test/performance/Earthfile index 685823a70..bd441e2b5 100644 --- a/test/performance/Earthfile +++ b/test/performance/Earthfile @@ -6,6 +6,7 @@ run: LOCALLY ARG args="" RUN go test -bench="Write" -run ^$ -tags it -report.file ./report/report.json -timeout 60m $args + SAVE ARTIFACT ./report/report.json AS LOCAL ./report/report.json generate-graphs: FROM core+base-image