Create boilerplate template from example #1
@ -1,8 +1,8 @@
|
|||||||
FROM python:3.12-bookworm
|
FROM python:3.12-bookworm
|
||||||
|
|
||||||
COPY requirements.txt /requirements.txt
|
COPY requirements.txt /requirements.txt
|
||||||
COPY entrypoint.py /entrypoint.py
|
COPY Add-on-script.py /Add-on-script.py
|
||||||
|
|
||||||
RUN pip install -r /requirements.txt
|
RUN pip install -r /requirements.txt
|
||||||
|
|
||||||
ENTRYPOINT [ "/entrypoint.py" ]
|
ENTRYPOINT [ "/Add-on-script.py" ]
|
||||||
|
56
action.yml
56
action.yml
@ -1,53 +1,51 @@
|
|||||||
name: "Generate BOM"
|
name: "Hardware DevOps Action"
|
||||||
description: >
|
description: >
|
||||||
Generate a BOM for the project using py-allspice and attach it as an artifact
|
A generic AllSpice Action Add-on for hardware development tasks such as schematic review,
|
||||||
to the run.
|
PCB review, ECO review, and release. This action demonstrates defining parameters
|
||||||
|
for these tasks and utilizing GitHub context information.
|
||||||
Works for Altium and OrCAD projects.
|
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
source_path:
|
source_path:
|
||||||
description: >
|
description: >
|
||||||
Path to the source file from the root of the repo. For Altium projects,
|
Path to the source file or directory from the root of the repo. For example,
|
||||||
this should be the path to the .PrjPcb file. For OrCAD projects, this
|
the path to a schematic or PCB file.
|
||||||
should be the path to the .dsn file.
|
|
||||||
required: true
|
required: true
|
||||||
output_file_name:
|
output_file_name:
|
||||||
description: "Name of the output file"
|
description: "Name of the output file"
|
||||||
required: true
|
required: true
|
||||||
default: "bom.csv"
|
default: "output.txt"
|
||||||
columns:
|
config_file:
|
||||||
description: >
|
description: >
|
||||||
A path to a JSON file mapping columns to the attributes they are from.
|
Path to a configuration file for the task.
|
||||||
required: true
|
required: true
|
||||||
group_by:
|
task_type:
|
||||||
description: >
|
description: >
|
||||||
A comma-separated list of columns to group the BOM by. If not present, the
|
The type of hardware task to perform. Options include 'Schematic-Review',
|
||||||
BOM will be flat.
|
'PCB-Review', 'ECO-Review', 'Release'.
|
||||||
default: ""
|
default: "Schematic-Review"
|
||||||
variant:
|
additional_params:
|
||||||
description: >
|
description: >
|
||||||
The variant of the project to generate the BOM for. If not present, the
|
Any additional parameters required for the task, provided as a JSON string.
|
||||||
BOM will be generated for the default variant. Not supported for OrCAD
|
default: "{}"
|
||||||
projects.
|
|
||||||
default: ""
|
|
||||||
runs:
|
runs:
|
||||||
using: "docker"
|
using: "docker"
|
||||||
image: "Dockerfile"
|
image: "Dockerfile"
|
||||||
args:
|
args:
|
||||||
- "--source_ref"
|
- "--source_ref"
|
||||||
- ${{ github.sha }}
|
- ${{ github.sha }}
|
||||||
- "--allspice_hub_url"
|
- "--server_url"
|
||||||
- ${{ github.server_url }}
|
- ${{ github.server_url }}
|
||||||
- "--columns"
|
- "--config_file"
|
||||||
- ${{ inputs.columns }}
|
- ${{ inputs.config_file }}
|
||||||
- "--group_by"
|
- "--task_type"
|
||||||
- ${{ inputs.group_by }}
|
- ${{ inputs.task_type }}
|
||||||
- "--variant"
|
- "--additional_params"
|
||||||
- ${{ inputs.variant }}
|
- ${{ inputs.additional_params }}
|
||||||
- "--output_file"
|
- "--output_file"
|
||||||
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
|
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
|
||||||
- ${{ github.repository }}
|
- ${{ github.repository }}
|
||||||
- ${{ inputs.source_path }}
|
- ${{ inputs.source_path }}
|
||||||
env:
|
|
||||||
ALLSPICE_AUTH_TOKEN: ${{ github.token }}
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
Loading…
Reference in New Issue
Block a user