mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 15:12:43 +00:00
We may want to replay or re-analyze historical benchmark data, so this keeps around the raw JSON results. The continuous benchmarks are GitHub action artifacts that are available for 90 days. The nightly benchmarks have their JSON attached to the release itself so that we have a permanent archive for nightlies going forward. This both supports historical analysis and replay/backfill. Details of making this work, plus several other improvements spotted while making the changes: - Use `actions/upload-artifact` to upload the JSON file in the relevant part of the workflow. This requires a new end-point to be available in our hardened runner, and saving the target SHA for re-use. - Passes `--backdate` with the timestamp of the commit to record a more accurate time. Especially important for nightly releases. - Increases `timeout-minutes` as the `nightly` runs can get too close to the prior timeout (44 minutes currently). - Adds an isolated `attach-nightly-release` job (`workflow_run` only, and gets separate permissions). This job has the write permissions, downloads all the relevant JSON files, compresses them, and attaches the archive to the most recent release. Assisted-by: Antigravity with Gemini
Workflows
Hardening
Workflows are hardened using Step Security tool. Findings for the "Harden Runner" steps are available online.
Allowed endpoints
Most jobs only have a few endpoints, but due to tools which do downloads, a few have significantly more. These are:
- benchmarks.yaml (Bazel, Bencher)
- clangd_tidy.yaml (Bazel)
- prek.yaml (Bazel, prek)
- nightly_release.yaml (Bazel)
- tests.yaml (Bazel)
When updating one of these, consider updating all of them.
We try to keep allowed-endpoints with one per line. Prettier wants to wrap
them, which we fix this with prettier-ignore.
Testing
We keep around an action-test branch in carbon-lang, which can be used to test
triggers with push: configurations. For example:
on:
push:
branches: [action-test]