From f52f76155d2d6bff8a4b29c54f8a8164b713c59d Mon Sep 17 00:00:00 2001 From: Gwendal Raoul Date: Tue, 25 Jun 2024 14:07:36 +0200 Subject: [PATCH] Add Github actions to test apps and for the doc --- .github/workflows/build_all_apps.yml | 27 +++++++++++++ .github/workflows/build_doc.yml | 60 ++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/build_all_apps.yml create mode 100644 .github/workflows/build_doc.yml diff --git a/.github/workflows/build_all_apps.yml b/.github/workflows/build_all_apps.yml new file mode 100644 index 0000000..23422d0 --- /dev/null +++ b/.github/workflows/build_all_apps.yml @@ -0,0 +1,27 @@ +name: Build all apps + +on: + push: + branches: + - 'rel_**' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: wirepas/sdk-builder:v1.5 + options: --user 0 + + steps: + - uses: actions/checkout@v2 + - name: Accept license + run: touch .license_accepted + - name: Create dummy key file + run: | + touch custom_bootloader_keys.ini + echo "[key:default]" >> custom_bootloader_keys.ini + echo "keytype = ES256_AES128CTR" >> custom_bootloader_keys.ini + echo "authprivate = 30 81 87 02 01 00 30 13 06 07 2A 86 48 CE 3D 02 01 06 08 2A 86 48 CE 3D 03 01 07 04 6D 30 6B 02 01 01 04 20 DB CA EB 07 95 D1 42 56 02 67 AC 4F 54 5F 81 28 6F 53 2E 7F 7B B7 36 23 56 A4 C4 4A 8A 30 0E 10 A1 44 03 42 00 04 4F 0F DD 10 BC 9F 88 5E 4A 7C 07 68 CC 5F 0D 95 61 07 02 D4 72 06 1D B9 05 79 43 BA 39 DB A2 10 7F 00 FD 74 27 EF BF FE 81 50 24 DE A3 F5 ED D3 89 47 36 8E 34 91 6E 1F AB 23 92 C3 9F 32 25 04" >> custom_bootloader_keys.ini + echo "encrypt = C0 BB 0F 86 BB CB F7 7A DD 46 0E CA 63 54 BC 50" >> custom_bootloader_keys.ini + - name: Build all apps + run: ./tools/sdk_builder.py --app_only diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml new file mode 100644 index 0000000..31c80fd --- /dev/null +++ b/.github/workflows/build_doc.yml @@ -0,0 +1,60 @@ +name: Build and deploy doc + +on: + release: + types: [created] + workflow_dispatch: + inputs: + version_name: + description: 'Version that will be used in version selector' + required: true + +jobs: + build: + + runs-on: ubuntu-latest + container: + image: wirepas/sdk-builder:v1.5 + options: --user 0 + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Generate doc + run: make doxygen target_board=pca10056 + - name: Set folder for release + if: ${{ github.event_name == 'release' }} + run: echo "FOLDER=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + - name: Set folder for manual triggering + if: ${{ github.event_name == 'workflow_dispatch' }} + run: echo "FOLDER=${{ github.event.inputs.version_name }}" >> $GITHUB_ENV + - name: Deploy doc + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/html + destination_dir: ${{ env.FOLDER }} + - name: Duplicate to latest folder too + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/html + destination_dir: 'latest' + - name: Checkout gh-pages branch + uses: actions/checkout@v2 + with: + ref: 'gh-pages' + path: 'gh-pages' + - name: Add new version + run: sed -i "/^'latest'/i '${{ env.FOLDER }}'," gh-pages/select_version.js + - name: Publish change + uses: EndBug/add-and-commit@v5 + with: + add: select_version.js + author_name: GH Action build_doc + author_email: invalid@invalid.com + branch: gh-pages + cwd: 'gh-pages' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}