From 0f0c8e09462c9b03e5067f259ee514b68560f326 Mon Sep 17 00:00:00 2001 From: Sam Xie Date: Wed, 31 Jul 2024 17:46:22 -0700 Subject: [PATCH 1/2] Fix benchmark that does not compare the exact result from the previous commit --- .github/workflows/benchmark.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7a9bdecac2e..49a2e32a7d2 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -24,7 +24,15 @@ jobs: uses: actions/cache@v4 with: path: ./benchmarks - key: ${{ runner.os }}-benchmark + # Use the current commit SHA as the cache key. + # This key won't exist on the first run, so the cache match falls back to restore-keys. + # Though, it won't be matched, the cache created will use this key as the cache key, + # so the next commit will be able to restore this cache (from the restore-keys). + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + key: ${{ runner.os }}-benchmark-${{ github.sha }} + # `github.event.before` means the commit before the push (i.e. the previous commit). + # So we can fetch the exact benchmark data from the previous commit. + restore-keys: ${{ runner.os }}-benchmark-${{ github.event.before }} - name: Store benchmarks result uses: benchmark-action/github-action-benchmark@v1.20.3 with: From edfa66fe8684fec7eb15d8e55e5e3a4291f2a173 Mon Sep 17 00:00:00 2001 From: Sam Xie Date: Wed, 31 Jul 2024 18:05:56 -0700 Subject: [PATCH 2/2] Fix typo --- .github/workflows/benchmark.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 49a2e32a7d2..d314e06c7af 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -26,8 +26,8 @@ jobs: path: ./benchmarks # Use the current commit SHA as the cache key. # This key won't exist on the first run, so the cache match falls back to restore-keys. - # Though, it won't be matched, the cache created will use this key as the cache key, - # so the next commit will be able to restore this cache (from the restore-keys). + # Though, it won't be matched, the cache created will use this key as the cache key. + # So the next commit will be able to restore this cache (from the restore-keys). # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#matching-a-cache-key key: ${{ runner.os }}-benchmark-${{ github.sha }} # `github.event.before` means the commit before the push (i.e. the previous commit).