- 2 Minutes to read
- Print
- DarkLight
- PDF
Basic Workflow Setup
- 2 Minutes to read
- Print
- DarkLight
- PDF
Adding workflows to your existing repos is easy. This example will show you how to add a repo that generates a bill of materials BOM from your project files.
The generate-bom
Add-on works with Altium, Cadence, and System Capture files. If your ECAD tool isn't listed and you want to get started, please reach out to support@allspice.io
Add a new workflow file
Create a file in your repo .allspice/workflows/hello-world.yml
- Select
your repository→Add File→New File
- Add the path, then the filename
.allspice/workflows/your-file-name.yml
. The form will automatically move from folder to folder to file as shown in this gif:
- Add a name to your workflow file.
name: Generate-BOM
- Add your Triggers to the workflow file.
# Triggers
on:
push:
issues:
# Trigger on issue open, close, or reopen
types: [opened, closed, reopened]
- Add a job and set
runs-on
toubuntu-latest
jobs:
Job-Hello-World:
runs-on: ubuntu-latest
- Add
steps:
to signal the beginning of individual steps.
steps:
- Add your first step, which calls the
generate-bom
Add-on. You can see the full list of customization in the generate-bom Add-on repo. This Add-on automatically creates a file with the default filename BOM.csv.
- name: Generate BOM
uses: https://hub.allspice.io/Actions/generate-bom@v0.5
with:
# The path to the project file in your repo.
# .PrjPcb for Altium, .DSN for OrCad, .SDAX for System Capture.
source_path: Archimajor.PrjPcb
variant: ""
- Modify the
source_path
file to match your project file. If you're not sure, reach out to support@allspice.io. In this example thesource_path
file is Archimajor.PrjPcb.
source_path: your-project-filename.PrjPcb
- Add a step to show the BOM in the run web interface.
cat
is a shell command that prints the file to the terminal.
- name: Show BOM
run: cat bom.csv
- Add a step to upload your BOM.csv as an Artifact file.
- name: Upload file as artifact
uses: actions/upload-artifact@v3
with:
name: BOM.csv
path: bom.csv
- Here is the complete file.
name: Generate-BOM
# Triggers
on:
push:
issues:
# Trigger on issue open, close, or reopen
types: [opened, closed, reopened]
jobs:
![click on actions tab.gif](https://cdn.document360.io/3d44af5c-3f49-4ca5-b152-10836a885c13/Images/Documentation/click%20on%20actions%20tab.gif){height="" width=""}
Job-Hello-World:
runs-on: ubuntu-latest
steps:
- name: Generate BOM
uses: https://hub.allspice.io/Actions/generate-bom@v0.5
with:
# The path to the project file in your repo.
# .PrjPcb for Altium, .DSN for OrCad, .SDAX for System Capture.
source_path: Archimajor.PrjPcb
variant: ""
- name: Show BOM
run: cat bom.csv
- name: Upload file as artifact
uses: actions/upload-artifact@v3
with:
name: BOM.csv
path: bom.csv
- Review the file then scroll down and click the “Commit Changes” button to commit the workflow file to the repository. You may add an optional commit message like "Add new workflow file".
Trigger your first action
The example above should trigger an action as soon as you commit the files.
This workflow specifies that actions will trigger on push
or issue open/close
To trigger this action again do one of the following:
- Push changes to the repo
- Open/New issue (This is the easiest to check)
- Close an issue
View Actions results
Visit the Actions tab and see the list of workflow runs.
Click on a workflow run.
Explore the run by clicking on the Step toggles.
Download the artifact by clicking the link on the left
To learn more about AllSpice Workflows, visit our Advanced Workflow Customization