nathanaelhuffman Building FPGA bitstreams #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: fpga-build | |
run-name: ${{ github.actor }} Building FPGA bitstreams | |
on: | |
[push] | |
jobs: | |
changes: | |
runs-on: self-hosted | |
permissions: | |
pull-requests: read | |
outputs: | |
cobble: ${{ steps.filter.outputs.cobble }} | |
buck2: ${{ steps.filter.outputs.buck2 }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: .github/filters.yml | |
grapefruit: | |
needs: changes | |
if: ${{ needs.changes.outputs.buck2 == 'true' }} | |
runs-on: self-hosted | |
steps: | |
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Update pip reqs | |
run : python3 -m pip install --upgrade -r tools/requirements.txt --break-system-packages | |
- name: buck path | |
run: echo "~/.cargo/bin:/opt/Xilinx/Vivado/2024.1/bin" >> "$GITHUB_PATH" | |
- name: Build grapefruit bitstream | |
run: buck2 build //hdl/projects/grapefruit:grapefruit --show-output | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: gfruit-image | |
path: "./buck-out/v2/gen/root/**/*" | |
bsv-streams: | |
needs: changes | |
if: ${{ needs.changes.outputs.buck2 == 'true' }} | |
runs-on: self-hosted | |
steps: | |
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Update pip reqs | |
run : python3 -m pip install --upgrade -r tools/requirements.txt --break-system-packages | |
- name: Env setup | |
run: cp BUILD.vars.gha BUILD.vars && echo "/opt/bsc-2022.01/bin" >> "$GITHUB_PATH" | |
- name: Restore build-dir | |
run: if [ -d /tmp/cobble_build_bkup ]; then cp -R /tmp/cobble_build_bkup ./build; else mkdir ./build; fi | |
- name: cobble init | |
run: ../vnd/cobble/cobble init .. --reinit | |
working-directory: ./build | |
- name: Build FPGAs | |
run: ./cobble build -v "//.*#bitstream" | |
working-directory: ./build | |
- name: backup build-dir | |
run: cp -R ./build /tmp/cobble_build_bkup | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bsv-images | |
path: "./build/latest/**/*" |