From f9c8e760b1d522e7d4c6e6b9e52e7247ab358fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 13 Oct 2022 08:51:51 +0200 Subject: [PATCH] CI: add failsafe web build & deployment to the user guide --- .github/workflows/failsafe_sim.yml | 44 ++++++++++++++++++++++++++++++ Jenkinsfile | 31 +++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/failsafe_sim.yml diff --git a/.github/workflows/failsafe_sim.yml b/.github/workflows/failsafe_sim.yml new file mode 100644 index 0000000000..6d5e73d5a5 --- /dev/null +++ b/.github/workflows/failsafe_sim.yml @@ -0,0 +1,44 @@ +name: Failsafe Simulator Build + +on: + push: + branches: + - 'main' + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + check: [ + "failsafe_web", + ] + container: + image: px4io/px4-dev-nuttx-focal:2021-09-08 + options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined + steps: + - uses: actions/checkout@v1 + with: + token: ${{ secrets.ACCESS_TOKEN }} + + - name: check environment + run: | + export + ulimit -a + - name: install emscripten + run: | + git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk + cd _emscripten_sdk + ./emsdk install latest + ./emsdk activate latest + - name: ${{matrix.check}} + run: | + . ./_emscripten_sdk/emsdk_env.sh + make ${{matrix.check}} diff --git a/Jenkinsfile b/Jenkinsfile index a9110d4227..b25af16dff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -162,6 +162,35 @@ pipeline { } } + stage('failsafe docs') { + agent { + docker { image 'px4io/px4-dev-base-focal:2021-08-18' } + } + steps { + sh '''#!/bin/bash -l + echo $0; + git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk; + cd _emscripten_sdk; + ./emsdk install latest; + ./emsdk activate latest; + . ./_emscripten_sdk/emsdk_env.sh; + make failsafe_web; + cd build/px4_sitl_default_failsafe_web; + mkdir -p failsafe_sim; + cp index.* parameters.json failsafe_sim; + ''' + dir('build/px4_sitl_default_failsafe_web') { + archiveArtifacts(artifacts: 'failsafe_sim/*') + stash includes: 'failsafe_sim/*', name: 'failsafe_sim' + } + } + post { + always { + sh 'make distclean; git clean -ff -x -d .' + } + } + } + stage('uORB graphs') { agent { docker { @@ -203,6 +232,7 @@ pipeline { unstash 'metadata_parameters' unstash 'metadata_module_documentation' unstash 'msg_documentation' + unstash 'failsafe_sim' unstash 'uorb_graph' withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) { sh('git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/PX4-user_guide.git') @@ -211,6 +241,7 @@ pipeline { sh('cp -R modules/*.md PX4-user_guide/en/modules/') sh('cp -R graph_*.json PX4-user_guide/.vuepress/public/en/middleware/') sh('cp -R msg_docs/*.md PX4-user_guide/en/msg_docs/') + sh('cp -R failsafe_sim/* PX4-user_guide/.vuepress/public/en/config/failsafe') sh('cd PX4-user_guide; git status; git add .; git commit -a -m "Update PX4 Firmware metadata `date`" || true') sh('cd PX4-user_guide; git push origin main || true') sh('rm -rf PX4-user_guide')