Create boilerplate template from example #1

Merged
AllSpiceAlice merged 11 commits from dd/dev into main 2024-07-22 01:14:25 +00:00
3 changed files with 17 additions and 22 deletions
Showing only changes of commit a047c86c54 - Show all commits

View File

@ -13,8 +13,6 @@ jobs:
- name: Run Hardware DevOps Action
uses: ./
with:
repository: "Add-on-template"
source_path: ".allspice/examples/input.txt"
output_file_name: "output.txt"
config_file: ".allspice/examples/config.yml"

View File

@ -32,10 +32,7 @@ if __name__ == "__main__":
description="Perform hardware development tasks such as Schematic-Review, PCB-Review, ECO-Review, and Release."
)
parser.add_argument(
"repository", help="The repo containing the project in the form 'owner/repo'"
)
parser.add_argument(
"source_file",
"--source_file",
help="The path to the source file used for the task. Example: 'Archimajor.PrjPcb', 'Schematics/Beagleplay.dsn'."
)
parser.add_argument(
@ -61,11 +58,6 @@ if __name__ == "__main__":
help="Any additional parameters required for the task, provided as a JSON string.",
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(
"--allspice_token",
help="Your AllSpice application token. Generate a token: https://hub.allspice.io/user/settings/applications",
@ -74,6 +66,10 @@ if __name__ == "__main__":
"--config_file",
help="Path to config file"
)
parser.add_argument(
"--input_file",
help="path/to/input_file"
)
args = parser.parse_args()
@ -83,7 +79,7 @@ if __name__ == "__main__":
exit(1)
# 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
hello_world(

View File

@ -5,7 +5,7 @@ description: >
for these tasks and utilizing GitHub context information.
inputs:
source_path:
source_file:
description: >
Path to the source file or directory from the root of the repo. For example,
the path to a schematic or PCB file.
@ -32,20 +32,21 @@ runs:
using: "docker"
image: "Dockerfile"
args:
- "--source_ref"
- ${{ github.sha }}
- "--server_url"
- ${{ github.server_url }}
- "--source_file"
- "${{ inputs.source_file}}"
- "--output_file"
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
- "--config_file"
- ${{ inputs.config_file }}
- "--task_type"
- ${{ inputs.task_type }}
- "--additional_params"
- ${{ inputs.additional_params }}
- "--output_file"
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
- ${{ github.repository }}
- ${{ inputs.source_path }}
- "--source_ref"
- ${{ allspice.sha }}
- "--server_url"
- ${{ allspice.server_url }}
- "--allspice_token"
- ${{ secrets.ALLSPICE_TOKEN }}
env:
GITHUB_TOKEN: ${{ github.token }}