Running common Actions
    • PDF

    Running common Actions

    • PDF

    Article Summary

    Actions demo

    This demo shows how to run an action on design files. This example uses our Altium Archimajor 3D printer control PCBA design files.

    Background

    This demo will call an action generate_bom from hub.allspice.io/Actions/generate-bom-altium repository and run it on the design files in the repository. The action opens a design.PrjPcB file and compiles a BOM from the project file.

    The repository is located https://hub.allspice.io/Actions/generate-bom-altium

    There’s a lot to learn about how actions map, but for this demo, we will keep it very simple.

    To run this demo, migrate our Actions demo repo and enable actions: https://hub.allspice.io/AllSpice-demos/Actions-Demo

    Workflow

    02-Running-common-Actions.yml

    # AllSpice Actions demo
    # Action triggers on push and issues
    # Action runs "generate-bom-altium" action
    # .allspice/workflows/generate_bom.yml
    name: Generate BOM
    on:
      push:
      issues:
        types: [opened, closed, reopened]
    
    jobs:
      Generate_BOM:
        runs-on: ubuntu-latest
        steps:
          - name: Generate BOM
           # Uses the "generate-bom-altium" action at version 0.0.1 to generate BOM
            uses: https://hub.allspice.io/Actions/generate-bom-altium@v0.0.1
            with:
              project_path: Archimajor.PrjPcb
              output_file_name: bom.csv
              pcb_path: Archimajor.PcbDoc
              # Maps the attributes BOM Column on the left and Altium Attribute Name on the right
              # "BOM Column name": ["ALTIUM ATTRIBUTE NAME"]
              attributes_mapping: '
                {
                  "manufacturer": ["Manufacturer", "MANUFACTURER"],
                  "part_number": ["PART", "MANUFACTURER #"],
                  "description": ["PART DESCRIPTION"],
                  "designator": ["Designator"]
                }'
          # Print bom.csv to terminal
          - name: Show BOM
            run: cat bom.csv
    
          - name: Upload file as artifact
            uses: actions/upload-artifact@v3
            with:
              name: BOM.csv
              path: bom.csv

    View Actions results

    After clicking on your workflow, you should see the results screen.

    You can click on each job step to see more details.

    • Set up job: This is boilerplate setup, is automatic, and can be ignored

    • Generate BOM: This is the output from the Action script

    • Show BOM: This is the contents of BOM.csv

    • Upload file as artifact: This shows information regarding uploading the file BOM.csv as an artifact file for future use or reference. May be used in other Actions.

    • Complete job: This is automatically generated and can be ignored.


    Next

    Pardon our dust

    We are renovating our documentation. Please check back shortly. To be notified of updates, please email support@allspice.io


    Was this article helpful?

    What's Next