Skip to content

Commit

Permalink
ci: github: adapt to new run-time requirements
Browse files Browse the repository at this point in the history
- export CMake configuration for Bridle (same as Zephyr)
- install Doxygen 1.9.2 from ppa:tiac-systems/doxygen
- support preview documentation (WEB deployment monitor)
- add manual workflow trigger for "QA License Check"
- add manual workflow trigger for "QA Compliance Check"
- add manual workflow trigger for "Documentation Remove"
- bump to "actions/labeler@v4"
- bump to "actions/stale@v6"
- bump to "actions/checkout@v3"
- bump to "actions/cache@v3"
- bump to "actions/upload-artifact@v3"
- bump to "actions/github-script@v6"
- bump to "mikepenz/action-junit-report@v3"

issues: #64

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Feb 20, 2023
1 parent 0e0ecd7 commit 5c0f2ee
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 41 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -53,16 +53,17 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout the code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: workspace/bridle

- name: Install packages
run: |
sudo add-apt-repository -y -u ppa:tiac-systems/doxygen
sudo apt-get install -y ninja-build doxygen mscgen graphviz
- name: Restore PIP Cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-doc-pip
Expand All @@ -80,6 +81,7 @@ jobs:
west init -l bridle
west update
west zephyr-export
west bridle-export
- name: Install documentation dependencies
working-directory: workspace
Expand All @@ -90,7 +92,7 @@ jobs:
- name: Build documentation
working-directory: workspace
run: |
cmake -B build -GNinja -DSPHINXOPTS_EXTRA="-W" bridle/doc
cmake -B build -GNinja bridle/doc
ninja -C build build-all
- name: Archive documentation
Expand All @@ -103,22 +105,28 @@ jobs:
mkdir doc && cd doc
archive="doc_build_${GITHUB_RUN_ID}.tgz"
tar -C ../html -zcf ${archive} .
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "publish2 development PR-${{ github.event.number }} ${archive}" > \
"monitor_${GITHUB_RUN_ID}.txt"
echo "${{ github.event.number }}" > pr.txt
else
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# basename will work for both branches and tags
branch=$(basename "${{ github.ref }}")
if [[ "${branch}" == "main" ]]; then
echo "publish2 approved latest ${archive}" > "monitor_${GITHUB_RUN_ID}.txt"
echo "publish2 preview REF-${branch} ${archive}" > "monitor_${GITHUB_RUN_ID}.txt"
else
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "publish2 development PR-${{ github.event.number }} ${archive}" > \
"monitor_${GITHUB_RUN_ID}.txt"
echo "${{ github.event.number }}" > pr.txt
else
echo "publish2 approved ${branch} ${archive}" > "monitor_${GITHUB_RUN_ID}.txt"
# basename will work for both branches and tags
branch=$(basename "${{ github.ref }}")
if [[ "${branch}" == "main" ]]; then
echo "publish2 approved latest ${archive}" > "monitor_${GITHUB_RUN_ID}.txt"
else
echo "publish2 approved ${branch} ${archive}" > "monitor_${GITHUB_RUN_ID}.txt"
fi
fi
fi
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: doc
path: workspace/build/doc
4 changes: 2 additions & 2 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -17,7 +17,7 @@ jobs:

steps:
- name: Download artifact
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/doc-remove.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0

name: Documentation Remove

on:
workflow_dispatch: # And manually on button click
pull_request:
types: [closed]
branches:
Expand All @@ -28,11 +29,19 @@ jobs:
- name: Create documentation removing monitor
run: |
mkdir doc && cd doc
echo "remove development PR-${{ github.event.number }}" > \
"monitor_${GITHUB_RUN_ID}.txt"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# basename will work for both branches and tags
branch=$(basename "${{ github.ref }}")
echo "remove preview REF-${branch}" > "monitor_${GITHUB_RUN_ID}.txt"
else
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "remove development PR-${{ github.event.number }}" > \
"monitor_${GITHUB_RUN_ID}.txt"
fi
fi
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: doc
path: doc
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -11,6 +11,6 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2.1.1
- uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
9 changes: 5 additions & 4 deletions .github/workflows/qa-compliance.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

name: QA Compliance Check

on:
workflow_dispatch: # And manually on button click
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -18,14 +19,14 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout the code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: workspace/bridle
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Restore PIP Cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-doc-pip
Expand Down Expand Up @@ -82,7 +83,7 @@ jobs:
continue-on-error: true

- name: Upload results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: compliance.xml
path: workspace/bridle/compliance.xml
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/qa-integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
rm -rf "${{ github.workspace }}/workspace"
- name: Checkout the code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: workspace/bridle
submodules: recursive
Expand All @@ -74,6 +74,7 @@ jobs:
west init -l bridle
west update
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
Expand All @@ -95,34 +96,42 @@ jobs:
# too high and most of the core tests are already performed by
# Zephyr in any case:
#
# --testcase-root zephyr/tests/arch/arm \
# --testcase-root zephyr/tests/kernel \
# --testsuite-root zephyr/tests/kernel \
# --testsuite-root zephyr/tests/arch/arm \
#
# Disabled in the meantime because the execution results
# <failure type="failure" message="Unknown" /> in the
# twister report XML file:
#
# --testsuite-root bridle/tests/drivers/watchdog \
#
export ZEPHYR_BASE="$(pwd)/zephyr"
export BRIDLE_BASE="$(pwd)/bridle"
./zephyr/scripts/twister --verbose --jobs 4 --inline-logs \
--enable-size-report --platform-reports \
--device-testing --hardware-map ${HARDWARE_MAP} \
--extra-args SHIELD=loopback_test_tmph \
--extra-args SHIELD="loopback_test_tmph" \
--board-root bridle/boards \
--testcase-root bridle/tests/bridle \
--testcase-root zephyr/tests/crypto/rand32 \
--testcase-root zephyr/tests/drivers/entropy \
--testcase-root zephyr/tests/drivers/watchdog \
--testcase-root zephyr/tests/drivers/counter \
--testcase-root zephyr/tests/drivers/entropy \
--testcase-root zephyr/tests/drivers/hwinfo \
--testcase-root zephyr/tests/drivers/gpio \
--testcase-root zephyr/tests/drivers/spi \
--testcase-root zephyr/tests/drivers/can
continue-on-error: true

- name: Upload results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: twister_report.xml
path: workspace/twister-out/twister_report.xml
continue-on-error: true

- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v2.4.2
uses: mikepenz/action-junit-report@v3
with:
check_name: twister-report (${{ matrix.board }})
report_paths: "**/twister-out/twister_report.xml"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/qa-licenses.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

name: QA License Check

on:
workflow_dispatch: # And manually on button click
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -14,16 +15,16 @@ jobs:

steps:
- name: Checkout the code
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Scan the code
uses: zephyrproject-rtos/action_scancode@v3
uses: zephyrproject-rtos/action_scancode@v4
id: scancode
with:
directory-to-scan: 'scan/'

- name: Upload results
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: scancode
path: ./artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout the code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: workspace/bridle
ref: ${{ github.event.pull_request.head.sha }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 TiaC Systems
# Copyright (c) 2021-2022 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

name: Mark Stale Issues and Pull Requests
Expand All @@ -18,7 +18,7 @@ jobs:
if: github.repository == 'tiacsys/bridle'

steps:
- uses: actions/stale@v3
- uses: actions/stale@v6
with:
days-before-stale: 90
days-before-close: 30
Expand Down

0 comments on commit 5c0f2ee

Please sign in to comment.