Decouple Doxygen, IBOMs, and Pinouts (#2293)

* split workflow file

* split scripts

* add jobs

* fix paths

* fix job names

* try

* switch to push for testing

* switch back to ftp, remove unneeded ppas

* dont fetch submodules
This commit is contained in:
David Holdeman 2021-02-06 12:43:43 -06:00 committed by GitHub
parent 04c7ad67aa
commit 55a238e83d
10 changed files with 254 additions and 51 deletions

View File

@ -13,21 +13,16 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Install prerequisite software
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository ppa:rmescandon/yq
sudo add-apt-repository ppa:kicad/kicad-5.1-releases
sudo apt-get update
sudo apt-get install ncftp kicad doxygen graphviz yq sshpass
sudo apt-get install doxygen graphviz ncftp
- name: Set FTP variables
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
INTERACTIVE_HTML_BOM_NO_DISPLAY: 'true'
run: |
if [ "${{github.ref}}" = "refs/heads/master" ]; then
echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}";

37
.github/workflows/gen-ibom.yaml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Generate Interactive BOMs
on:
push:
branches: master
# schedule:
# - cron: '0 0 * * *'
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install prerequisite software
run: |
sudo add-apt-repository ppa:kicad/kicad-5.1-releases
sudo apt-get update
sudo apt-get install kicad ncftp
- name: Set FTP variables
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
if [ "${{github.ref}}" = "refs/heads/master" ]; then
echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}";
echo "::set-env name=RUSEFI_DOXYGEN_FTP_USER::${{secrets.RUSEFI_DOXYGEN_FTP_USER}}";
echo "::set-env name=RUSEFI_DOXYGEN_FTP_PASS::${{secrets.RUSEFI_DOXYGEN_FTP_PASS}}";
fi
- name: Generate documentation
env:
INTERACTIVE_HTML_BOM_NO_DISPLAY: 'true'
run: bash ./misc/jenkins/generate_ibom/gen_upload_ibom.sh

36
.github/workflows/gen-pinouts.yaml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Generate Interactive Pinouts
on:
push:
branches: master
# schedule:
# - cron: '0 0 * * *'
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install prerequisite software
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository ppa:rmescandon/yq
sudo apt-get update
sudo apt-get install yq ncftp
- name: Set FTP variables
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
if [ "${{github.ref}}" = "refs/heads/master" ]; then
echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}";
echo "::set-env name=RUSEFI_DOXYGEN_FTP_USER::${{secrets.RUSEFI_DOXYGEN_FTP_USER}}";
echo "::set-env name=RUSEFI_DOXYGEN_FTP_PASS::${{secrets.RUSEFI_DOXYGEN_FTP_PASS}}";
fi
- name: Generate documentation
run: bash ./misc/jenkins/generate_pinouts/gen_upload_pinouts.sh

View File

@ -1,17 +1,5 @@
#!/bin/bash
echo "Should be executed from project root folder. Will try to upload to $RUSEFI_FTP_SERVER"
pwd
# ibom is part of Doxygen job simply in order to reduce workspace HDD usage on my tiny build server
bash misc/jenkins/InteractiveHtmlBom/run.sh
if [ -n "$RUSEFI_FTP_SERVER" ]; then
echo "Uploading IBOMs"
tar -cvzf - -C hardware ibom |\
sshpass -p $RUSEFI_DOXYGEN_FTP_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_DOXYGEN_FTP_USER@$RUSEFI_FTP_SERVER \
"(tar -xzvf - -C ~)"
fi
pwd
cd firmware
@ -22,38 +10,6 @@ doxygen || { echo "doxygen run FAILED"; exit 1; }
cd ../doxygen
if [ -n "$RUSEFI_FTP_SERVER" ]; then
echo "Uploading Doxygen"
tar -cvzf - html |\
sshpass -p $RUSEFI_DOXYGEN_FTP_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_DOXYGEN_FTP_USER@$RUSEFI_FTP_SERVER \
"(tar -xzvf - -C ~)"
fi
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }
cd ..
CONNECTORS=$(find -path "./firmware/config/boards/*/connectors/*.yaml")
for c in $CONNECTORS; do
echo "processing "$c
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')
echo "DIR "$DIR
NAME=$(basename $c .yaml)
echo "NAME "$NAME
mkdir -p $DIR
bash misc/pinout-gen/gen.sh $c > $DIR/$NAME.html
file $DIR/$NAME.html
IMG=$(yq r $c 'info.image.file')
echo "IMG "$IMG
if [ $IMG ]; then
cp $(dirname $c)/$IMG $DIR
fi
ls $DIR
cp misc/pinout-gen/yaml.min.js $DIR
ls $DIR
done
if [ -n "$RUSEFI_FTP_SERVER" ]; then
echo "Uploading Pinouts"
tar -cvzf - pinouts |\
sshpass -p $RUSEFI_DOXYGEN_FTP_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_DOXYGEN_FTP_USER@$RUSEFI_FTP_SERVER \
"(tar -xzvf - -C ~)"
ncftpput -R -m -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /html html/*
fi
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }

View File

@ -0,0 +1,2 @@
@echo off
bash.exe misc\jenkins\generate_ibom\gen_upload_ibom.sh

View File

@ -0,0 +1,12 @@
#!/bin/bash
echo "Should be executed from project root folder. Will try to upload to $RUSEFI_FTP_SERVER"
pwd
# ibom is part of Doxygen job simply in order to reduce workspace HDD usage on my tiny build server
bash misc/jenkins/InteractiveHtmlBom/run.sh
if [ -n "$RUSEFI_FTP_SERVER" ]; then
echo "Uploading IBOMs"
ncftpput -R -m -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /ibom hardware/ibom/*
fi
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }

View File

@ -0,0 +1,2 @@
@echo off
bash.exe misc\jenkins\generate_pinouts\gen_upload_pinouts.sh

View File

@ -0,0 +1,27 @@
#!/bin/bash
CONNECTORS=$(find -path "./firmware/config/boards/*/connectors/*.yaml")
for c in $CONNECTORS; do
echo "processing "$c
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')
echo "DIR "$DIR
NAME=$(basename $c .yaml)
echo "NAME "$NAME
mkdir -p $DIR
bash misc/pinout-gen/gen.sh $c > $DIR/$NAME.html
file $DIR/$NAME.html
IMG=$(yq r $c 'info.image.file')
echo "IMG "$IMG
if [ $IMG ]; then
cp $(dirname $c)/$IMG $DIR
fi
ls $DIR
cp misc/pinout-gen/yaml.min.js $DIR
ls $DIR
done
if [ -n "$RUSEFI_FTP_SERVER" ]; then
echo "Uploading Pinouts"
ncftpput -R -m -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /pinouts pinouts/*
fi
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }

View File

@ -0,0 +1,68 @@
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<jenkins.model.BuildDiscarderProperty>
<strategy class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>100</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.1">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/rusefi/rusefi</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions/>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers>
<hudson.triggers.SCMTrigger>
<spec>10 03 * * *</spec>
<ignorePostCommitHooks>false</ignorePostCommitHooks>
</hudson.triggers.SCMTrigger>
</triggers>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.BatchFile>
<command>call misc\jenkins\generate_ibom\gen_upload_ibom.bat</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher plugin="discard-old-build@1.05">
<daysToKeep>30</daysToKeep>
<numToKeep>-1</numToKeep>
<resultsToDiscard/>
<minLogFileSize>-1</minLogFileSize>
<maxLogFileSize>-1</maxLogFileSize>
<intervalDaysToKeep>-1</intervalDaysToKeep>
<intervalNumToKeep>-1</intervalNumToKeep>
<regexp></regexp>
</org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher>
</publishers>
<buildWrappers>
<hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.36">
<deleteDirs>false</deleteDirs>
<cleanupParameter></cleanupParameter>
<externalDelete></externalDelete>
<disableDeferredWipeout>false</disableDeferredWipeout>
</hudson.plugins.ws__cleanup.PreBuildCleanup>
</buildWrappers>
</project>

View File

@ -0,0 +1,68 @@
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<jenkins.model.BuildDiscarderProperty>
<strategy class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>100</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.1">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/rusefi/rusefi</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions/>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers>
<hudson.triggers.SCMTrigger>
<spec>10 03 * * *</spec>
<ignorePostCommitHooks>false</ignorePostCommitHooks>
</hudson.triggers.SCMTrigger>
</triggers>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.BatchFile>
<command>call misc\jenkins\generate_pinouts\gen_upload_pinouts.bat</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher plugin="discard-old-build@1.05">
<daysToKeep>30</daysToKeep>
<numToKeep>-1</numToKeep>
<resultsToDiscard/>
<minLogFileSize>-1</minLogFileSize>
<maxLogFileSize>-1</maxLogFileSize>
<intervalDaysToKeep>-1</intervalDaysToKeep>
<intervalNumToKeep>-1</intervalNumToKeep>
<regexp></regexp>
</org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher>
</publishers>
<buildWrappers>
<hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.36">
<deleteDirs>false</deleteDirs>
<cleanupParameter></cleanupParameter>
<externalDelete></externalDelete>
<disableDeferredWipeout>false</disableDeferredWipeout>
</hudson.plugins.ws__cleanup.PreBuildCleanup>
</buildWrappers>
</project>