mirror of
https://staging.allspice.dev/AllSpice-Demos/Actions-demo.git
synced 2025-04-24 01:03:43 +00:00
Merge pull request 'Update actions demos' (#22) from develop into main
Reviewed-on: https://staging.allspice.dev/AllSpice-Demos/Actions-demo/pulls/22 Reviewed-by: shrikanthup <shrikanthup@noreply.staging.allspice.dev> Reviewed-by: kyle <kyle@allspice.io>
This commit is contained in:
commit
25172dd086
7
.allspice/columns.json
Normal file
7
.allspice/columns.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"Part Number": ["PART", "MANUFACTURER #"],
|
||||
"Manufacturer": ["Manufacturer", "MANUFACTURER"],
|
||||
"Part ID": ["_part_id"],
|
||||
"Designator": ["Designator"],
|
||||
"Description": ["PART DESCRIPTION"]
|
||||
}
|
14
.allspice/workflows/00-Workflow-syntax-minimal.yml
Normal file
14
.allspice/workflows/00-Workflow-syntax-minimal.yml
Normal file
@ -0,0 +1,14 @@
|
||||
name: Workflow-syntax-minimal
|
||||
|
||||
on:
|
||||
push:
|
||||
issues:
|
||||
# Trigger on issue open, close, or reopen
|
||||
types: [opened, closed, reopened]
|
||||
|
||||
jobs:
|
||||
Job-Hello-World:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Print Hello World 🔎"
|
||||
run: echo "Hello World"
|
57
.allspice/workflows/01-Workflow-syntax-commented.yml
Normal file
57
.allspice/workflows/01-Workflow-syntax-commented.yml
Normal file
@ -0,0 +1,57 @@
|
||||
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
# Lines beginning with a `#` are comments, and only intended to help reviewers understand the script
|
||||
# Actions documentation: https://learn.allspice.io/docs/actions-cicd
|
||||
# This file is written in YAML syntax, to learn more about YAML visit https://learn.allspice.io/docs/yaml
|
||||
|
||||
# Workflow name
|
||||
name: Workflow-syntax-commented
|
||||
|
||||
# Workflow triggers on
|
||||
# To learn more about triggers, visit https://learn.allspice.io/docs/actions-triggers
|
||||
on:
|
||||
# Workflow is triggered if any of the following events occur
|
||||
# i.e. Logical OR of triggers, i.e. trigger on push or issues
|
||||
|
||||
# Trigger on push
|
||||
push:
|
||||
|
||||
# Trigger on issues
|
||||
issues:
|
||||
# Trigger on issue open, close, or reopen
|
||||
types: [opened, closed, reopened]
|
||||
|
||||
|
||||
# Workflow jobs
|
||||
# Jobs run in parallel by default
|
||||
# To run jobs in sequence, create multiple steps in a job
|
||||
jobs:
|
||||
|
||||
# Job name
|
||||
Job-Hello-World:
|
||||
|
||||
# Set up server container using Ubuntu operating system (Debian based Linux distribution)
|
||||
# To learn more about Ubuntu, visit https://ubuntu.com/
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Job steps
|
||||
# Steps run in sequence on the runner machine
|
||||
# To make steps run in parallel, create multiple jobs
|
||||
steps:
|
||||
|
||||
# Job steps start with - name: "Step name"
|
||||
- name: "Print Hello World 🔎"
|
||||
|
||||
# run keyword specifies the shell command to run
|
||||
# The shell command is a simple echo command to print "Hello World"
|
||||
# The command is run in the runner machine
|
||||
# To learn more about shell commands, visit https://www.shellscript.sh/
|
||||
run: echo "Hello World"
|
||||
|
||||
- name: "Multiline shell command 🔎"
|
||||
|
||||
# The shell command is a simple echo command to print two lines of text
|
||||
# The | pipe character is used to specify a multiline command
|
||||
run: |
|
||||
echo "This is the first line"
|
||||
echo "This is the second line"
|
52
.allspice/workflows/02-Running-common-Actions.yml
Normal file
52
.allspice/workflows/02-Running-common-Actions.yml
Normal file
@ -0,0 +1,52 @@
|
||||
# AllSpice Running common Actions workflow
|
||||
# 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:
|
||||
# Checkout is only needed if columns.json is committed in your Altium project repo.
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Generate BOM
|
||||
uses: https://hub.allspice.io/Actions/generate-bom-altium@v0.2
|
||||
with:
|
||||
# The path to the Altium project file in your repo.
|
||||
project_path: Archimajor.PrjPcb
|
||||
|
||||
# [optional] A path to a JSON file mapping columns to the component attributes
|
||||
# they are from. This file must be provided.
|
||||
# Default: 'columns.json'
|
||||
columns: .allspice/columns.json
|
||||
|
||||
# [optional] The path to the output file that will be generated.
|
||||
# Default: 'bom.csv'
|
||||
output_file_name: bom.csv
|
||||
|
||||
# [optional] A comma-separated list of columns to group the BOM by. If empty
|
||||
# or not present, the BOM will be flat.
|
||||
# Default: ''
|
||||
group_by: 'Part ID'
|
||||
|
||||
# [optional] The variant of the project to generate the BOM for. If empty
|
||||
# or not present, the BOM will be generated for the default variant.
|
||||
# Default: ''
|
||||
variant: ''
|
||||
|
||||
# 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
|
@ -1,36 +0,0 @@
|
||||
# .allspice/workflows/test.yml
|
||||
name: AllSpice Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out AllSpice Actions 🚀
|
||||
on:
|
||||
push:
|
||||
issues:
|
||||
types: [opened, closed, reopened]
|
||||
env:
|
||||
text_black_on_white: "\u001b[90;107m"
|
||||
text_black_on_green: "\u001b[90;102m"
|
||||
text_green_on_grey: "\u001b[92;100m"
|
||||
text_blue_on_yellow: "\u001b[94;103m"
|
||||
text_plain: "\u001b[0m"
|
||||
|
||||
jobs:
|
||||
Generate-Netlist:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Python 🐍->🖥️
|
||||
uses: actions/checkout@v3
|
||||
- name: Install requirements 🤼->🖥️
|
||||
run: pip install -r .allspice/utils/requirements.txt
|
||||
- name: Generate Netlist 🔎
|
||||
run: |
|
||||
echo -e "repo ${{ gitea.repository }}"
|
||||
ALLSPICE_AUTH_TOKEN=${{ github.token }} python .allspice/utils/generate_netlist.py "${{ gitea.repository }}" "Archimajor.PcbDoc" --allspice_hub_url "https://hub.allspice.io" --output_file Archimajor.pcbdoc.netlist.txt
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Archimajor.PcbDoc.netlist.txt
|
||||
path: Archimajor.pcbdoc.netlist.txt
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
|
||||
|
||||
|
||||
|
@ -1,34 +0,0 @@
|
||||
# .allspice/workflows/generate_bom.yml
|
||||
name: Generate BOM
|
||||
run-name: ${{ gitea.actor }} is testing out AllSpice Actions 🚀
|
||||
on:
|
||||
push:
|
||||
issues:
|
||||
types: [opened, closed, reopened]
|
||||
|
||||
jobs:
|
||||
Generate_BOM:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate BOM
|
||||
uses: https://hub.allspice.io/Actions/generate-bom-altium@68a6ce75898ef695eecca0206b70007f0f6617ad
|
||||
with:
|
||||
project_path: Archimajor.PrjPcb
|
||||
output_file_name: bom.csv
|
||||
pcb_path: Archimajor.PcbDoc
|
||||
attributes_mapping: '
|
||||
{
|
||||
"manufacturer": ["Manufacturer", "MANUFACTURER"],
|
||||
"part_number": ["PART", "MANUFACTURER #"],
|
||||
"description": ["PART DESCRIPTION"],
|
||||
"designator": ["Designator"]
|
||||
}
|
||||
'
|
||||
- name: Show BOM
|
||||
run: cat bom.csv
|
||||
- name: Upload file as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: BOM.csv
|
||||
path: bom.csv
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
@ -1,34 +0,0 @@
|
||||
name: 🧸-Hello-World
|
||||
run-name: ${{ gitea.actor }} is testing out AllSpice Actions 🚀
|
||||
on:
|
||||
push:
|
||||
issues:
|
||||
types: [opened, closed, reopened]
|
||||
env:
|
||||
text_black_on_white: "\u001b[90;107m"
|
||||
text_black_on_green: "\u001b[90;102m"
|
||||
text_green_on_grey: "\u001b[92;100m"
|
||||
text_blue_on_yellow: "\u001b[94;103m"
|
||||
text_plain: "\u001b[0m"
|
||||
|
||||
jobs:
|
||||
🧸-Hello-World:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "[📚->🖥️] Check out repository code"
|
||||
uses: actions/checkout@v3
|
||||
- name: "[🤼->🖥️] Install requirements"
|
||||
run: pip install -r .allspice/utils/requirements.txt
|
||||
- name: "[🏋🏽..🏋🏽] Test Actions Server 🔎"
|
||||
run: |
|
||||
echo -e "🎉 The job was automatically triggered by a $text_black_on_white ${{ gitea.event_name }} $text_plain event."
|
||||
echo -e "🐧 This job is now running on a $text_black_on_white ${{ runner.os }} $text_plain server hosted by $text_blue_on_yellow AllSpice! $text_plain"
|
||||
echo -e "🔎 $text_black_on_green owner_name/repo_name $text_plain -> $text_green_on_grey branch_name $text_plain ... $text_black_on_green ${{ gitea.repository }} $text_plain -> $text_green_on_grey ${{ gitea.ref_name }} $text_plain"
|
||||
- name: "[🔎->📂] List files in repo 🔎"
|
||||
run: |
|
||||
ls -a -h -s -R -I ".git*" ${{ gitea.workspace }}
|
||||
- name: "[🔑->🕸️] Test AllSpice API with py-allspice 🔎"
|
||||
run: python .allspice/utils/py-allspice-BIST.py --allspice_hub_url ${{ github.server_url }} --allspice_token ${{ github.token }}
|
||||
|
||||
|
||||
|
Mosfets.SchDoc
Normal file
Ctrl + Scroll to zoom
Loading…
Reference in New Issue
Block a user