2023-02-02 15:27:21 -05:00
|
|
|
|
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
pull_request: {}
|
|
|
|
# allow manual runs:
|
|
|
|
workflow_dispatch: {}
|
|
|
|
|
|
|
|
jobs:
|
2024-04-19 03:37:41 -04:00
|
|
|
check-firmware:
|
2023-02-02 15:27:21 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2024-03-21 10:54:58 -04:00
|
|
|
image: ghcr.io/tillitis/tkey-builder:4
|
2023-02-02 15:27:21 -05:00
|
|
|
steps:
|
|
|
|
- name: checkout
|
2024-03-21 10:54:58 -04:00
|
|
|
uses: actions/checkout@v4
|
2023-02-02 15:27:21 -05:00
|
|
|
with:
|
|
|
|
# fetch-depth: 0
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: fix
|
|
|
|
# https://github.com/actions/runner-images/issues/6775
|
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2024-04-19 03:37:41 -04:00
|
|
|
- name: check indentation in firmware C code
|
2024-03-21 07:11:33 -04:00
|
|
|
working-directory: hw/application_fpga
|
|
|
|
run: |
|
|
|
|
make -C fw/tk1 checkfmt
|
|
|
|
make -C fw/testfw checkfmt
|
|
|
|
|
|
|
|
- name: run static analysis on firmware C code
|
|
|
|
working-directory: hw/application_fpga
|
|
|
|
run: |
|
|
|
|
make check
|
|
|
|
|
2024-04-19 03:37:41 -04:00
|
|
|
- name: compile firmware and testfw
|
|
|
|
working-directory: hw/application_fpga
|
|
|
|
run: make firmware.bin testfw.bin
|
|
|
|
|
|
|
|
check-verilog:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/tillitis/tkey-builder:4
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
# fetch-depth: 0
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: fix
|
|
|
|
# https://github.com/actions/runner-images/issues/6775
|
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2024-03-21 07:11:33 -04:00
|
|
|
- name: lint verilog using verilator
|
|
|
|
working-directory: hw/application_fpga
|
|
|
|
run: make lint
|
|
|
|
|
2024-09-20 04:59:11 -04:00
|
|
|
build-usb-firmware:
|
2024-04-19 03:37:41 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/tillitis/tkey-builder:4
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
# fetch-depth: 0
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: fix
|
|
|
|
# https://github.com/actions/runner-images/issues/6775
|
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2023-02-13 10:57:34 -05:00
|
|
|
- name: compile ch552 firmware
|
2024-06-19 07:26:46 -04:00
|
|
|
working-directory: hw/usb_interface/ch552_fw
|
2023-02-13 10:57:34 -05:00
|
|
|
run: make
|
2023-02-02 15:27:21 -05:00
|
|
|
|
2024-04-19 03:37:41 -04:00
|
|
|
build-bitstream:
|
|
|
|
outputs:
|
|
|
|
commit_sha: ${{ github.sha }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/tillitis/tkey-builder:4
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
# fetch-depth: 0
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: fix
|
|
|
|
# https://github.com/actions/runner-images/issues/6775
|
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2023-02-13 10:57:34 -05:00
|
|
|
- name: make production test gateware
|
|
|
|
working-directory: hw/production_test/application_fpga_test_gateware
|
|
|
|
run: make
|
|
|
|
|
|
|
|
- name: make application FPGA gateware
|
|
|
|
working-directory: hw/application_fpga
|
|
|
|
run: make all
|
|
|
|
|
2024-04-17 05:23:15 -04:00
|
|
|
- name: Cache binaries
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
hw/application_fpga/application_fpga.bin
|
|
|
|
hw/application_fpga/firmware.bin
|
2024-04-19 03:37:41 -04:00
|
|
|
key: build-${{ github.run_number }}-${{ github.sha }}-${{ github.run_attempt }}
|
2024-04-17 05:23:15 -04:00
|
|
|
|
|
|
|
check-hashes:
|
2024-04-19 03:37:41 -04:00
|
|
|
needs: build-bitstream
|
2024-04-17 05:23:15 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/tillitis/tkey-builder:4
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: Retrieve binaries from cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
hw/application_fpga/application_fpga.bin
|
|
|
|
hw/application_fpga/firmware.bin
|
2024-04-19 03:37:41 -04:00
|
|
|
key: build-${{ github.run_number }}-${{ needs.build-bitstream.outputs.commit_sha }}-${{ github.run_attempt }}
|
2024-04-17 05:23:15 -04:00
|
|
|
|
|
|
|
- name: check matching hashes for firmware.bin & application_fpga.bin
|
|
|
|
working-directory: hw/application_fpga
|
|
|
|
run: make check-binary-hashes
|
2024-04-19 03:37:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
# TODO? first deal with hw/boards/ and hw/production_test/
|
|
|
|
# - name: check for SPDX tags
|
|
|
|
# run: ./LICENSES/spdx-ensure
|