Skip to content

Commit

Permalink
update workflow with fpga device parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtaylor1982 committed Dec 28, 2024
1 parent 80eb859 commit 25c6d0e
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 70 deletions.
74 changes: 28 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
name: build

on:
push:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
inputs:
device:
type: choice
required: true
description: FPGA device
options:
- 10M02SCU169C8G
- 10M04SCU169C8G
- 10M16SCU169C8G
workflow_call:

inputs:
device:
type: string
required: true
description: FPGA device
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -27,51 +35,25 @@ jobs:
latest: true
out-file-path: '/usr/local/bin'
fileName: 'gencrc'

- name: add +x permission to gencrc
run: chmod +x /usr/local/bin/gencrc
# 1 - Checkout repository

- name: Checkout repository
uses: actions/checkout@v4
# 2 - RTL synthesis 10M16
- name: Run compilation flow 10M16
working-directory: Quartus
run: quartus_sh -t RESDMAC.tcl -device 10M16SCU169C8G -version $VERSION
- name: calcualte 10M16 checksums
run: |
sha256sum Quartus/output_files_10M16SCU169C8G/RESDMAC.pof > Quartus/output_files_10M16SCU169C8G/RESDMAC.pof.sha256
gencrc Quartus/output_files_10M16SCU169C8G/resdmac_cfm0_auto.rpd > Quartus/output_files_10M16SCU169C8G/resdmac_cfm0_auto.crc32
# 3 - Upload artifacts
- name: Upload 10M16SCU169C8G Firmware
uses: actions/upload-artifact@v4
with:
name: OutputFiles_10M16_${{ env.VERSION }}.zip
path: Quartus/output_files_10M16SCU169C8G
retention-days: 14
# 4 - RTL synthesis 10M04
- name: Run compilation flow 10M04

- name: Run compilation flow ${{ inputs.device }}
working-directory: Quartus
run: quartus_sh -t RESDMAC.tcl -device 10M04SCU169C8G -version $VERSION
- name: calcualte 10M04 checksums
run: quartus_sh -t RESDMAC.tcl -device ${{ inputs.device }} -version $VERSION

- name: calcualte file checksums
run: |
sha256sum Quartus/output_files_10M04SCU169C8G/RESDMAC.pof > Quartus/output_files_10M04SCU169C8G/RESDMAC.pof.sha256
gencrc Quartus/output_files_10M04SCU169C8G/resdmac_cfm0_auto.rpd > Quartus/output_files_10M04SCU169C8G/resdmac_cfm0_auto.crc32
# 5 - Upload artifacts
- name: Upload 10M04SCU169C8G Firmware
uses: actions/upload-artifact@v4
with:
name: OutputFiles_10M04_${{ env.VERSION }}.zip
path: Quartus/output_files_10M04SCU169C8G
retention-days: 14
# 6 - RTL synthesis 10M02
- name: Run compilation flow 10M02
working-directory: Quartus
run: quartus_sh -t RESDMAC.tcl -device 10M02SCU169C8G -version $VERSION
- name: calcualte 10M02 checksums
run: sha256sum Quartus/output_files_10M02SCU169C8G/RESDMAC.pof > Quartus/output_files_10M02SCU169C8G/RESDMAC.pof.sha256
# 7 - Upload artifacts
- name: Upload 10M02SCU169C8G Firmware
sha256sum Quartus/output_files_${{ inputs.device }}/RESDMAC.pof > Quartus/output_files_${{ inputs.device }}/RESDMAC.pof.sha256
gencrc Quartus/output_files_${{ inputs.device }}/resdmac_cfm0_auto.rpd > Quartus/output_files_${{ inputs.device }}/resdmac_cfm0_auto.crc32
- name: Upload Firmware
uses: actions/upload-artifact@v4
with:
name: OutputFiles_10M02_${{ env.VERSION }}.zip
path: Quartus/output_files_10M02SCU169C8G
retention-days: 14
name: OutputFiles_${{ inputs.device }}_${{ env.VERSION }}.zip
path: Quartus/output_files_${{ inputs.device }}
retention-days: 14
24 changes: 24 additions & 0 deletions .github/workflows/build_on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: build_on_push

on:
push:
branches:
- main
paths-ignore:
- '**.md'
jobs:
build_firmware_10M02:
secrets: inherit
uses: ./.github/workflows/build.yml
with:
device: 10M02SCU169C8G
build_firmware_10M04:
secrets: inherit
uses: ./.github/workflows/build.yml
with:
device: 10M04SCU169C8G
build_firmware_10M16:
secrets: inherit
uses: ./.github/workflows/build.yml
with:
device: 10M16SCU169C8G
60 changes: 36 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,30 @@ on:
jobs:
kicad_outputs:
uses: ./.github/workflows/kicad.yml
build_firmware:
build_firmware_10M02:
secrets: inherit
uses: ./.github/workflows/build.yml
with:
device: 10M02SCU169C8G
build_firmware_10M04:
secrets: inherit
uses: ./.github/workflows/build.yml
with:
device: 10M04SCU169C8G
build_firmware_10M16:
secrets: inherit
uses: ./.github/workflows/build.yml
with:
device: 10M16SCU169C8G
test:
uses: ./.github/workflows/test.yml
secrets: inherit
ADF:
needs: [build_firmware]
needs: [build_firmware_10M02, build_firmware_10M04, build_firmware_10M16]
uses: ./.github/workflows/make_adf.yml
secrets: inherit
create_release:
needs: [kicad_outputs, build_firmware, test, ADF]
needs: [kicad_outputs, build_firmware_10M02, build_firmware_10M04, build_firmware_10M16, test, ADF]
runs-on: ubuntu-latest

steps:
Expand All @@ -31,16 +43,16 @@ jobs:
mkdir -p releases
mv ./KiCad_Outputs.zip ./KiCad_Outputs
zip -r ./releases/KiCad_Outputs_${{ github.ref_name }}.zip ./KiCad_Outputs
cp OutputFiles_10M16_${{ github.ref_name }}.zip/RESDMAC.pof ./releases/RESDMAC_10M16_${{ github.ref_name }}.pof
cp OutputFiles_10M04_${{ github.ref_name }}.zip/RESDMAC.pof ./releases/RESDMAC_10M04_${{ github.ref_name }}.pof
cp OutputFiles_10M02_${{ github.ref_name }}.zip/RESDMAC.pof ./releases/RESDMAC_10M02_${{ github.ref_name }}.pof
cp OutputFiles_10M16_${{ github.ref_name }}.zip/resdmac_cfm0_auto.rpd ./releases/RESDMAC_10M16_${{ github.ref_name }}.rpd
cp OutputFiles_10M04_${{ github.ref_name }}.zip/resdmac_cfm0_auto.rpd ./releases/RESDMAC_10M04_${{ github.ref_name }}.rpd
cp OutputFiles_10M16_${{ github.ref_name }}.zip/RESDMAC.pof.sha256 ./releases/RESDMAC_10M16_${{ github.ref_name }}.pof.sha256
cp OutputFiles_10M04_${{ github.ref_name }}.zip/RESDMAC.pof.sha256 ./releases/RESDMAC_10M04_${{ github.ref_name }}.pof.sha256
cp OutputFiles_10M02_${{ github.ref_name }}.zip/RESDMAC.pof.sha256 ./releases/RESDMAC_10M02_${{ github.ref_name }}.pof.sha256
cp OutputFiles_10M16_${{ github.ref_name }}.zip/resdmac_cfm0_auto.crc32 ./releases/RESDMAC_10M16_${{ github.ref_name }}.rpd.crc32
cp OutputFiles_10M04_${{ github.ref_name }}.zip/resdmac_cfm0_auto.crc32 ./releases/RESDMAC_10M04_${{ github.ref_name }}.rpd.crc32
cp OutputFiles_10M16SCU169C8G_${{ github.ref_name }}.zip/RESDMAC.pof ./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.pof
cp OutputFiles_10M04SCU169C8G_${{ github.ref_name }}.zip/RESDMAC.pof ./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.pof
cp OutputFiles_10M02SCU169C8G_${{ github.ref_name }}.zip/RESDMAC.pof ./releases/RESDMAC_10M02SCU169C8G_${{ github.ref_name }}.pof
cp OutputFiles_10M16SCU169C8G_${{ github.ref_name }}.zip/resdmac_cfm0_auto.rpd ./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.rpd
cp OutputFiles_10M04SCU169C8G_${{ github.ref_name }}.zip/resdmac_cfm0_auto.rpd ./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.rpd
cp OutputFiles_10M16SCU169C8G_${{ github.ref_name }}.zip/RESDMAC.pof.sha256 ./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.pof.sha256
cp OutputFiles_10M04SCU169C8G_${{ github.ref_name }}.zip/RESDMAC.pof.sha256 ./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.pof.sha256
cp OutputFiles_10M02SCU169C8G_${{ github.ref_name }}.zip/RESDMAC.pof.sha256 ./releases/RESDMAC_10M02SCU169C8G_${{ github.ref_name }}.pof.sha256
cp OutputFiles_10M16SCU169C8G_${{ github.ref_name }}.zip/resdmac_cfm0_auto.crc32 ./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.rpd.crc32
cp OutputFiles_10M04SCU169C8G_${{ github.ref_name }}.zip/resdmac_cfm0_auto.crc32 ./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.rpd.crc32
- name: Create a new GitHub release
Expand All @@ -52,17 +64,17 @@ jobs:
draft: true
generate_release_notes: true
files: |
ReSDMAC_Utils${{ github.ref_name }}.adf
ReSDMAC_Utils${{ github.ref_name }}.adf
./releases/KiCad_Outputs_${{ github.ref_name }}.zip
./releases/RESDMAC_10M16_${{ github.ref_name }}.pof
./releases/RESDMAC_10M04_${{ github.ref_name }}.pof
./releases/RESDMAC_10M02_${{ github.ref_name }}.pof
./releases/RESDMAC_10M16_${{ github.ref_name }}.rpd
./releases/RESDMAC_10M04_${{ github.ref_name }}.rpd
./releases/RESDMAC_10M16_${{ github.ref_name }}.rpd.crc32
./releases/RESDMAC_10M04_${{ github.ref_name }}.rpd.crc32
./releases/RESDMAC_10M16_${{ github.ref_name }}.pof.sha256
./releases/RESDMAC_10M04_${{ github.ref_name }}.pof.sha256
./releases/RESDMAC_10M02_${{ github.ref_name }}.pof.sha256
./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.pof
./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.pof
./releases/RESDMAC_10M02SCU169C8G_${{ github.ref_name }}.pof
./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.rpd
./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.rpd
./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.rpd.crc32
./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.rpd.crc32
./releases/RESDMAC_10M16SCU169C8G_${{ github.ref_name }}.pof.sha256
./releases/RESDMAC_10M04SCU169C8G_${{ github.ref_name }}.pof.sha256
./releases/RESDMAC_10M02SCU169C8G_${{ github.ref_name }}.pof.sha256

0 comments on commit 25c6d0e

Please sign in to comment.