1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

ci: Add tests for examples folder

examples/readme: add missing entries

examples: document examples with no readme
This commit is contained in:
AnnsAnn 2024-11-12 10:26:59 +01:00
parent 10b63585ea
commit 83e93a5b73
7 changed files with 91 additions and 0 deletions

View File

@ -129,6 +129,8 @@ run ./dist/tools/feature_resolution/check.sh
run ./dist/tools/boards_supported/check.sh
run ./dist/tools/codespell/check.sh
run ./dist/tools/cargo-checks/check.sh
run ./dist/tools/examples_check/check_has_readme.sh
run ./dist/tools/examples_check/check_in_readme.sh
if [ -z "${GITHUB_RUN_ID}" ]; then
run ./dist/tools/uncrustify/uncrustify.sh --check
else

27
dist/tools/examples_check/check_has_readme.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# Path to the examples directory
EXAMPLES_DIR="$(dirname "$0")/../../../examples"
# Get a list of all directories in the examples directory
directories=$(find "$EXAMPLES_DIR" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)
# Check each directory
missing_entries=()
for dir in $directories; do
if [ ! -f "$EXAMPLES_DIR/$dir/README.md" ]; then
missing_entries+=("$dir")
fi
done
# Report missing entries
if [ ${#missing_entries[@]} -eq 0 ]; then
echo "All examples have a README"
exit 0
else
echo "The following directories are missing a README:"
for entry in "${missing_entries[@]}"; do
echo "- $entry"
done
exit 1
fi

30
dist/tools/examples_check/check_in_readme.sh vendored Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
# Path to the examples directory
EXAMPLES_DIR="$(dirname "$0")/../../../examples"
# Path to the README.md file
README_FILE="$EXAMPLES_DIR/README.md"
# Get a list of all directories in the examples directory
directories=$(find "$EXAMPLES_DIR" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)
# Check each directory
missing_entries=()
for dir in $directories; do
if ! grep -q "$dir" "$README_FILE"; then
missing_entries+=("$dir")
fi
done
# Report missing entries
if [ ${#missing_entries[@]} -eq 0 ]; then
echo "All directories are listed in the README.md file."
exit 0
else
echo "The following directories are missing in the README.md file:"
for entry in "${missing_entries[@]}"; do
echo "- $entry"
done
exit 1
fi

View File

@ -74,6 +74,8 @@ Here is a quick overview of the examples available in the RIOT:
- [gcoap_fileserver](./gcoap_fileserver/README.md)
- This example demonstrates the usage of the `gcoap`
module to serve files over CoAP.
- [gcoap_dtls](./gcoap_dtls/README.md)
- This example demonstrates the usage of the `gcoap` module with DTLS.
- [nanocoap_server](./nanocoap_server/README.md)
- This example demonstrates the usage of the `nanocoap` module, a high-level API for CoAP (Constrained Application Protocol) messaging.
@ -145,6 +147,7 @@ Here is a quick overview of the examples available in the RIOT:
### Misc
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Updated upstream
- [lorawan](./lorawan/README.md)
- This application shows a basic LoRaWAN use-case with RIOT.
- [openthread](./openthread/README.md)
@ -163,6 +166,22 @@ Here is a quick overview of the examples available in the RIOT:
- [sniffer](./sniffer/README.md)
- This application is built to run together with the script `./tools/sniffer.py`
as a sniffer for (wireless) data traffic.
- [benckmark_udp](./benchmark_udp/README.md)
- This example uses the `benchmark_udp` module to create a stress-test for the RIOT network stack.
====================================================================================================
| Example | Description |
|---------|-------------|
| [lorawan](./lorawan/README.md) | This application shows a basic LoRaWAN use-case with RIOT. |
| [openthread](./openthread/README.md) | This example demonstrates the usage of the OpenThread stack in RIOT. |
| [lwm2m](./lwm2m/README.md) | Example of a LWM2M client on RIOT |
| [ccn-lite-relay](./ccn-lite-relay/README.md) | This application demonstrates how to use the Content-Centric Networking stack from [CCN-Lite](http://www.ccn-lite.net/) on RIOT |
| [telnet_server](./telnet_server/README.md) | Simple telnet server that listens on port 23 over IPv6. |
| [posix_sockets](./posix_sockets/README.md) | Showcase for RIOT's POSIX socket support |
| [spectrum-scanner](./spectrum-scanner/README.md) | This example demonstrates how to monitor energy levels on all available wireless channels |
| [sniffer](./sniffer/README.md) | This application is built to run together with the script `./tools/sniffer.py` as a sniffer for (wireless) data traffic. |
| [benckmark_udp](./benchmark_udp/README.md) | This example uses the `benchmark_udp` module to create a stress-test for the RIOT network stack. |
| [sock_tcp_echo](./sock_tcp_echo/README.md) | This is a simple TCP echo server / client that uses the SOCK API. |
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Stashed changes
## Advanced Examples
@ -188,3 +207,7 @@ Here is a quick overview of the examples available in the RIOT:
- This example allows testing different two-way ranging algorithms between
two boards supporting a dw1000 device. This makes use of the uwb-core
pkg.
- [senml_saul](./senml_saul/README.md)
- This example demonstrates the usage of the SAUL (Sensor Actuator Uber Layer) module with the SenML (Sensor Measurement Lists) format.
- [opendsme](./opendsme/README.md)
- This example demonstrates the usage of the OpenDSME module in RIOT.

View File

@ -0,0 +1,3 @@
# GCoAP Fileserver
This example demonstrates how to create a CoAP server that serves files from the filesystem.

View File

@ -0,0 +1,3 @@
# RaspberryPi Pico PIO Blink
This example demonstrates how to use the PIO peripheral on the RaspberryPi Pico to blink an LED. The PIO peripheral is a programmable I/O block that can be used to implement custom digital interfaces that work at extremely high speeds.

View File

@ -0,0 +1,3 @@
# senml_saul
This example demonstrates the usage of the SAUL (Sensor Actuator Uber Layer) module with the SenML (Sensor Measurement Lists) format.