diff --git a/.github/workflows/gen-docs.yaml b/.github/workflows/gen-docs.yaml new file mode 100644 index 0000000000..67001c5cc4 --- /dev/null +++ b/.github/workflows/gen-docs.yaml @@ -0,0 +1,33 @@ +name: Generate documentation + +on: + push: + branches: + - master + +jobs: + generate: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - name: Install ncftp, kicad, xvfb, and doxygen + run: | + sudo add-apt-repository ppa:js-reynaud/kicad-5.1 + sudo apt-get update + sudo apt-get install ncftp kicad doxygen xvfb + + - name: Set FTP variables + run: | + if [ "${{github.event_name}}" = "push" ] && [ "${{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: xvfb-run bash ./misc/jenkins/generate_doxygen/gen_upload_docs.sh diff --git a/.gitmodules b/.gitmodules index 38fd919b7f..44a4af1c1c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,6 +15,3 @@ [submodule "hardware/InteractiveHtmlBom"] path = hardware/InteractiveHtmlBom url = https://github.com/openscopeproject/InteractiveHtmlBom.git -[submodule "misc/InteractiveHtmlBom"] - path = misc/InteractiveHtmlBom - url = https://github.com/openscopeproject/InteractiveHtmlBom diff --git a/misc/InteractiveHtmlBom b/misc/InteractiveHtmlBom deleted file mode 160000 index 14945d7553..0000000000 --- a/misc/InteractiveHtmlBom +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 14945d7553940520e11c42f4db9cb2273f57ff3f diff --git a/misc/jenkins/InteractiveHtmlBom/run.bat b/misc/jenkins/InteractiveHtmlBom/run.bat index 3b559f9185..4707a587c0 100644 --- a/misc/jenkins/InteractiveHtmlBom/run.bat +++ b/misc/jenkins/InteractiveHtmlBom/run.bat @@ -1,2 +1,2 @@ @echo off -sh.exe misc\jenkins\InteractiveHtmlBom\run.sh +bash.exe misc\jenkins\InteractiveHtmlBom\run.sh diff --git a/misc/jenkins/InteractiveHtmlBom/run.sh b/misc/jenkins/InteractiveHtmlBom/run.sh index 819e77f5d3..157e6e9cb7 100644 --- a/misc/jenkins/InteractiveHtmlBom/run.sh +++ b/misc/jenkins/InteractiveHtmlBom/run.sh @@ -1,6 +1,7 @@ #!/bin/bash -IBOM_CMD="python misc/InteractiveHtmlBom/generate_interactive_bom.py --no-browser --name-format \"%f_latest\" --dest-dir ../ibom" +INTERACTIVE_HTML_BOM_NO_DISPLAY="true" +IBOM_CMD="python3 hardware/InteractiveHtmlBom/InteractiveHtmlBom/generate_interactive_bom.py --no-browser --name-format \"%f_latest\" --dest-dir ../ibom" echo "IBOM_CMD=$IBOM_CMD" pwd diff --git a/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat b/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat index 98d47077a0..f241493e0a 100644 --- a/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat +++ b/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat @@ -1,2 +1,2 @@ @echo off -sh.exe misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh +bash.exe misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh diff --git a/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh b/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh index 8ee7dbcde2..a75cf64f9a 100644 --- a/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh +++ b/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh @@ -24,6 +24,7 @@ cd firmware date "+%a %D %T.%2S" echo "$SCRIPT_NAME: will be Erasing chip" + [ -e flash_erase407.sh ] || { echo "NOT FOUND flash_erase.sh"; exit 1; } echo "$SCRIPT_NAME: Erasing chip" bash flash_erase407.sh @@ -41,6 +42,7 @@ bash clean_compile_two_versions.sh echo "$SCRIPT_NAME: Building DFU" if uname | grep "NT"; then chmod u+x ../misc/encedo_hex2dfu/hex2dfu.exe + # ../misc/encedo_hex2dfu/hex2dfu.exe -i deliver/rusefi_no_asserts.hex -o deliver/rusefi_no_asserts.dfu ../misc/encedo_hex2dfu/hex2dfu.exe -i deliver/rusefi.hex -o deliver/rusefi.dfu else @@ -74,7 +76,6 @@ export BUNDLE_FULL_NAME="rusefi_bundle" bash misc/jenkins/build_working_folder.sh [ $? -eq 0 ] || { echo "$SCRIPT_NAME: ERROR: invoking build_working_folder.sh"; exit 1; } - echo "$SCRIPT_NAME: Going back to root folder" cd "$ROOT_FOLDER" pwd diff --git a/misc/jenkins/generate_doxygen/gen_upload_docs.bat b/misc/jenkins/generate_doxygen/gen_upload_docs.bat index d2a75ad9e4..e7686ac7f4 100644 --- a/misc/jenkins/generate_doxygen/gen_upload_docs.bat +++ b/misc/jenkins/generate_doxygen/gen_upload_docs.bat @@ -1,2 +1,2 @@ @echo off -sh.exe misc\jenkins\generate_doxygen\gen_upload_docs.sh +bash.exe misc\jenkins\generate_doxygen\gen_upload_docs.sh diff --git a/misc/jenkins/generate_doxygen/gen_upload_docs.sh b/misc/jenkins/generate_doxygen/gen_upload_docs.sh index 6a339ed161..c23acbc518 100644 --- a/misc/jenkins/generate_doxygen/gen_upload_docs.sh +++ b/misc/jenkins/generate_doxygen/gen_upload_docs.sh @@ -1,11 +1,14 @@ #!/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 -echo "Uploading IBOMs" -ncftpput -R -v -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /ibom hardware/ibom/* + +if [ -n "$RUSEFI_FTP_SERVER" ]; then + echo "Uploading IBOMs" + ncftpput -R -v -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /ibom hardware/ibom/* +fi pwd cd firmware @@ -15,6 +18,8 @@ doxygen || { echo "doxygen run FAILED"; exit 1; } # http://www.ncftp.com/download/ # actually Cygwin http://rusefi.com/wiki/index.php?title=Internal:Software:Build_Server cd ../doxygen -echo "Uploading Doxygen" -ncftpput -R -v -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /html html/* +if [ -n "$RUSEFI_FTP_SERVER" ]; then + echo "Uploading Doxygen" + ncftpput -R -v -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" /html html/ +fi [ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }