lowRISC / lowRISC/opentitan

[ci] Use GitHub cache for bitstreams also when merging PRs

Open Beginner friendly
#31,261 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

### Description

This is a follow up of #31059, where the GitHub cache was introduced to skip FPGA bitstream rebuilds on "trivial" PR updates (i.e. updates which do not touch the bitstream sources and hence do not require it being rebuilt).

In #31059 it was decided to only enable the GitHub cache in pull requests, which causes the bitstream to be recomputed when merging PRs, despite it being available in the GitHub cache. This issue is to track removing such a restriction. This can be done by removing the line:
```yaml
use_gh_cache: ${{ github.event_name == 'pull_request' }
```
in the file `.github/workflows/ci.yml` (in the job `chip_earlgrey_cw340` when using the `bitstream.yml` reusable workflow). This would cause the merge job to load the bitstream from the GitHub cache and then save it to the GCS bitstream cache.

It should be noted that, at present, removing the restriction as described above would cause the GitHub cache to be used even for PRs that do not touch the bitstream sources. This happens for PRs that miss the GCS cache and - at the same time - hit the GH cache. This somewhat unexpected behaviour should disappear if we update the GCS cache to use the same cache hashing mechanism as used for the GH cache.

Contributor guide

Open the contributing guide

Research direction

Start in .github/workflows/ci.yml at the chip_earlgrey_cw340 job, where the bitstream.yml reusable workflow is used, and read how use_gh_cache is set. Remove the pull-request-only restriction and verify that merge jobs can load the bitstream from the GitHub cache and save it to the GCS bitstream cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, yaml
Domain
ci-cd
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.