Create boilerplate template from example #1
@ -13,8 +13,6 @@ jobs:
|
|||||||
- name: Run Hardware DevOps Action
|
- name: Run Hardware DevOps Action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|
||||||
repository: "Add-on-template"
|
|
||||||
source_path: ".allspice/examples/input.txt"
|
source_path: ".allspice/examples/input.txt"
|
||||||
output_file_name: "output.txt"
|
output_file_name: "output.txt"
|
||||||
config_file: ".allspice/examples/config.yml"
|
config_file: ".allspice/examples/config.yml"
|
||||||
|
@ -32,10 +32,7 @@ if __name__ == "__main__":
|
|||||||
description="Perform hardware development tasks such as Schematic-Review, PCB-Review, ECO-Review, and Release."
|
description="Perform hardware development tasks such as Schematic-Review, PCB-Review, ECO-Review, and Release."
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"repository", help="The repo containing the project in the form 'owner/repo'"
|
"--source_file",
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"source_file",
|
|
||||||
help="The path to the source file used for the task. Example: 'Archimajor.PrjPcb', 'Schematics/Beagleplay.dsn'."
|
help="The path to the source file used for the task. Example: 'Archimajor.PrjPcb', 'Schematics/Beagleplay.dsn'."
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@ -61,11 +58,6 @@ if __name__ == "__main__":
|
|||||||
help="Any additional parameters required for the task, provided as a JSON string.",
|
help="Any additional parameters required for the task, provided as a JSON string.",
|
||||||
default="{}",
|
default="{}",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
"--allspice_hub_url",
|
|
||||||
help="The URL of your AllSpice Hub instance. Defaults to https://hub.allspice.io.",
|
|
||||||
default="https://hub.allspice.io",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--allspice_token",
|
"--allspice_token",
|
||||||
help="Your AllSpice application token. Generate a token: https://hub.allspice.io/user/settings/applications",
|
help="Your AllSpice application token. Generate a token: https://hub.allspice.io/user/settings/applications",
|
||||||
@ -74,6 +66,10 @@ if __name__ == "__main__":
|
|||||||
"--config_file",
|
"--config_file",
|
||||||
help="Path to config file"
|
help="Path to config file"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--input_file",
|
||||||
|
help="path/to/input_file"
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@ -83,7 +79,7 @@ if __name__ == "__main__":
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# Test connection to AllSpice API
|
# Test connection to AllSpice API
|
||||||
test_allspice_connection(args.allspice_hub_url, auth_token)
|
test_allspice_connection(args.server_url, auth_token)
|
||||||
|
|
||||||
# Perform the Hello World task
|
# Perform the Hello World task
|
||||||
hello_world(
|
hello_world(
|
||||||
|
21
action.yml
21
action.yml
@ -5,7 +5,7 @@ description: >
|
|||||||
for these tasks and utilizing GitHub context information.
|
for these tasks and utilizing GitHub context information.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
source_path:
|
source_file:
|
||||||
description: >
|
description: >
|
||||||
Path to the source file or directory from the root of the repo. For example,
|
Path to the source file or directory from the root of the repo. For example,
|
||||||
the path to a schematic or PCB file.
|
the path to a schematic or PCB file.
|
||||||
@ -32,20 +32,21 @@ runs:
|
|||||||
using: "docker"
|
using: "docker"
|
||||||
image: "Dockerfile"
|
image: "Dockerfile"
|
||||||
args:
|
args:
|
||||||
- "--source_ref"
|
- "--source_file"
|
||||||
- ${{ github.sha }}
|
- "${{ inputs.source_file}}"
|
||||||
- "--server_url"
|
- "--output_file"
|
||||||
- ${{ github.server_url }}
|
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
|
||||||
- "--config_file"
|
- "--config_file"
|
||||||
- ${{ inputs.config_file }}
|
- ${{ inputs.config_file }}
|
||||||
- "--task_type"
|
- "--task_type"
|
||||||
- ${{ inputs.task_type }}
|
- ${{ inputs.task_type }}
|
||||||
- "--additional_params"
|
- "--additional_params"
|
||||||
- ${{ inputs.additional_params }}
|
- ${{ inputs.additional_params }}
|
||||||
- "--output_file"
|
- "--source_ref"
|
||||||
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
|
- ${{ allspice.sha }}
|
||||||
- ${{ github.repository }}
|
- "--server_url"
|
||||||
- ${{ inputs.source_path }}
|
- ${{ allspice.server_url }}
|
||||||
|
- "--allspice_token"
|
||||||
|
- ${{ secrets.ALLSPICE_TOKEN }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
Loading…
Reference in New Issue
Block a user