1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-14 02:33:21 +02:00
opentelemetry-go/.github
Sam Xie f7977e064c
Fix benchmark that does not compare the exact result from the previous commit (#5664)
Part of #4537

The benchmark action does not compare the exact result from the previous
commit. For instance, a recent action
https://github.com/open-telemetry/opentelemetry-go/actions/runs/10175392022
compares 2a454a776a, which is a commit
that pushed a week ago.

This is because `actions/cache@v4` will not refresh the cache when the
key exists.

This is the logs from
https://github.com/open-telemetry/opentelemetry-go/actions/runs/10175392022/job/28170968531
on `Post Download previous benchmark data` step.

```
Cache hit occurred on the primary key Linux-benchmark, not saving cache.
```

Moreover, GitHub action only invalidates the key that has not been
accessed in over 7 days, which means forever in our case as long as we
push a new commit to the main branch.


https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy

---

To fix this, I use the current sha as the cache key and then use the
previous sha to fetch the cache. So, our benchmark can compare the exact
result from the previous commit.

Action result from my fork:
https://github.com/XSAM/opentelemetry-go/actions/runs/10189773887/job/28188416879
2024-08-01 16:39:05 -07:00
..
ISSUE_TEMPLATE Update RELEASING.md to obtain steps to verify the changes for contrib (#5284) 2024-05-09 15:05:56 -07:00
workflows Fix benchmark that does not compare the exact result from the previous commit (#5664) 2024-08-01 16:39:05 -07:00
codecov.yaml Remove deprecated exporters (#2020) 2021-06-19 17:29:56 -04:00