Files
chipyard/.github/actions/prepare-rtl/action.yml
2022-08-23 00:44:21 +00:00

43 lines
1.3 KiB
YAML

name: prepare-rtl
description: 'Builds RTL based on parameters, caches the entire chipyard root dir when done'
inputs:
group-key:
description: group key
required: true
build-script:
description: rtl build script to use
required: false
default: "remote-do-rtl-build.sh"
build-type:
description: type of build
required: false
default: "sim"
toolchain:
description: toolchain to use
required: false
default: "riscv-tools"
runs:
using: "composite"
steps:
- uses: actions/cache@v3
id: rtl-build-id
with:
path: |
sims/verilator
sims/firesim/sim
generators/gemmini/software/gemmini-rocc-tests
key: ${{ inputs.group-key }}-${{ github.sha }}
- name: Run RTL build if not cached
run: |
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-${{ inputs.toolchain }}
if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then
echo "Cache miss on ${{ inputs.group-key }}-${{ github.sha }}"
./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }}
else
echo "Cache hit do not rebuild RTL for ${{ inputs.group-key }}"
fi
shell: bash -leo pipefail {0}