Changes to the GitHub action:
- `config` is now optional - added `targets` to specify what we want to generate
This commit is contained in:
parent
6d0a3b2bd3
commit
25c1fea649
|
|
@ -4,7 +4,8 @@ author: 'Salvador E. Tropea'
|
||||||
inputs:
|
inputs:
|
||||||
config:
|
config:
|
||||||
description: 'The plotting config file to use'
|
description: 'The plotting config file to use'
|
||||||
required: true
|
required: false
|
||||||
|
default: '__SCAN__'
|
||||||
dir:
|
dir:
|
||||||
description: 'The output directory [default: .]'
|
description: 'The output directory [default: .]'
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -21,6 +22,10 @@ inputs:
|
||||||
description: 'Skip preflights, comma separated or "all" [default: no skip]'
|
description: 'Skip preflights, comma separated or "all" [default: no skip]'
|
||||||
required: false
|
required: false
|
||||||
default: '__NONE__'
|
default: '__NONE__'
|
||||||
|
targets:
|
||||||
|
description: 'List of targets to generate separated by spaces. To only run preflights use __NONE__ [default: generate all]'
|
||||||
|
required: false
|
||||||
|
default: '__ALL__'
|
||||||
variant:
|
variant:
|
||||||
description: 'Global variant to use [default: no variants]'
|
description: 'Global variant to use [default: no variants]'
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -38,6 +43,7 @@ runs:
|
||||||
- -b ${{ inputs.board }}
|
- -b ${{ inputs.board }}
|
||||||
- -e ${{ inputs.schema }}
|
- -e ${{ inputs.schema }}
|
||||||
- -s ${{ inputs.skip }}
|
- -s ${{ inputs.skip }}
|
||||||
|
- -t ${{ inputs.targets }}
|
||||||
- -v ${{ inputs.verbose }}
|
- -v ${{ inputs.verbose }}
|
||||||
- -V ${{ inputs.variant }}
|
- -V ${{ inputs.variant }}
|
||||||
branding:
|
branding:
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ SCHEMA=""
|
||||||
SKIP=""
|
SKIP=""
|
||||||
DIR=""
|
DIR=""
|
||||||
VARIANT=""
|
VARIANT=""
|
||||||
|
TARGETS=""
|
||||||
|
|
||||||
# Exit error code
|
# Exit error code
|
||||||
EXIT_ERROR=1
|
EXIT_ERROR=1
|
||||||
|
|
@ -44,6 +45,7 @@ function msg_help {
|
||||||
echo -e " -b, --board FILE .kicad_pcb board file. Use __SCAN__ to get the first board file found in current folder."
|
echo -e " -b, --board FILE .kicad_pcb board file. Use __SCAN__ to get the first board file found in current folder."
|
||||||
echo -e " -e, --schema FILE .sch schematic file. Use __SCAN__ to get the first schematic file found in current folder."
|
echo -e " -e, --schema FILE .sch schematic file. Use __SCAN__ to get the first schematic file found in current folder."
|
||||||
echo -e " -s, --skip Skip preflights, comma separated or 'all'"
|
echo -e " -s, --skip Skip preflights, comma separated or 'all'"
|
||||||
|
echo -e " -t, --targets List of targets to generate separated by spaces. To only run preflights use __NONE__."
|
||||||
echo -e " -V, --variant Global variant"
|
echo -e " -V, --variant Global variant"
|
||||||
|
|
||||||
echo -e "\nMiscellaneous:"
|
echo -e "\nMiscellaneous:"
|
||||||
|
|
@ -109,22 +111,35 @@ function args_process {
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-c | --config ) shift
|
-c | --config ) shift
|
||||||
CONFIG="$1"
|
if [ "$1" == "__SCAN__" ]; then
|
||||||
|
CONFIG=""
|
||||||
|
else
|
||||||
|
CONFIG="-c $1"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
-b | --board ) shift
|
-b | --board ) shift
|
||||||
if [ "$1" == "__SCAN__" ]; then
|
if [ "$1" == "__SCAN__" ]; then
|
||||||
BOARD="-b "`ls -1 *.kicad_pcb | head -n1`
|
BOARD=""
|
||||||
else
|
else
|
||||||
BOARD="-b $1"
|
BOARD="-b $1"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
-e | --schematic ) shift
|
-e | --schematic ) shift
|
||||||
if [ "$1" == "__SCAN__" ]; then
|
if [ "$1" == "__SCAN__" ]; then
|
||||||
SCHEMA="-e "`ls -1 *.*sch | head -n1`
|
SCHEMA=""
|
||||||
else
|
else
|
||||||
SCHEMA="-e $1"
|
SCHEMA="-e $1"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
-t | --targets ) shift
|
||||||
|
if [ "$1" == "__NONE__" ]; then
|
||||||
|
TARGETS="-i"
|
||||||
|
elif [ "$1" == "__ALL__" ]; then
|
||||||
|
TARGETS=""
|
||||||
|
else
|
||||||
|
TARGETS="$1"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
-V | --variant ) shift
|
-V | --variant ) shift
|
||||||
if [ "$1" == "__NONE__" ]; then
|
if [ "$1" == "__NONE__" ]; then
|
||||||
VARIANT=""
|
VARIANT=""
|
||||||
|
|
@ -176,7 +191,7 @@ function run {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $CONFIG ]; then
|
if [ -f $CONFIG ]; then
|
||||||
kibot -c $CONFIG $DIR $BOARD $SCHEMA $SKIP $VERBOSE $VARIANT
|
kibot -c $CONFIG $DIR $BOARD $SCHEMA $SKIP $VERBOSE $VARIANT $TARGETS
|
||||||
else
|
else
|
||||||
echo "config file '$CONFIG' not found!"
|
echo "config file '$CONFIG' not found!"
|
||||||
exit $EXIT_ERROR
|
exit $EXIT_ERROR
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue