Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI improvements #273

Merged
merged 21 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/arduino_esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install requirements
run: |
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ on:
branches: [ '**' ]

jobs:
run_tests:
name: Run unit tests on ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build & run tests
run: |
sudo apt install -y ninja-build
CMAKE_GENERATOR=Ninja make test

check_format:
name: Check codebase format with clang-format
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run clang-format dry-run
run: find . -iname "*.ino" -o -iname "*.h" -o -iname "*.c" | xargs clang-format -n -Werror

modular_build:
name: Modular build on ubuntu-latest
runs-on: ubuntu-latest
Expand All @@ -38,7 +60,8 @@ jobs:

- name: Build project
run: |
make all
sudo apt install -y ninja-build
CMAKE_GENERATOR=Ninja make
python3 ./build/tests/modularity.py --pub $Z_FEATURE_PUBLICATION --sub $Z_FEATURE_SUBSCRIPTION --queryable $Z_FEATURE_QUERYABLE --query $Z_FEATURE_QUERY
timeout-minutes: 5
env:
Expand All @@ -51,4 +74,4 @@ jobs:
if: always()
run: |
docker stop zenoh_router
docker rm zenoh_router
docker rm zenoh_router
6 changes: 3 additions & 3 deletions .github/workflows/build-shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Compile debug
run: make all
env:
Expand All @@ -44,10 +44,10 @@ jobs:
name: Build on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Crosscompile debug
run: make crossbuilds
env:
BUILD_TYPE: Debug
BUILD_SHARED_LIBS: ON
ZENOH_DEBUG: 3
ZENOH_DEBUG: 3
4 changes: 2 additions & 2 deletions .github/workflows/build-static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Compile debug
run: make all
env:
Expand All @@ -44,7 +44,7 @@ jobs:
name: Build on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Crosscompile debug
run: make crossbuilds
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codacy-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/emscripten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: jwlawson/[email protected]
- uses: mymindstorm/setup-emsdk@v11
- name: Compile debug
run: |
mkdir build
emcmake cmake -E env CFLAGS="-DZ_FEATURE_LINK_WS=1 -DZ_FEATURE_LINK_TCP=0 -DZ_FEATURE_LINK_UDP_MULTICAST=0 -DZ_FEATURE_LINK_UDP_UNICAST=0 -DZ_FEATURE_SCOUTING_UDP=0" cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_STANDARD=11 -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF -DBUILD_MULTICAST=OFF -DBUILD_INTEGRATION=OFF -DBUILD_TOOLS=OFF -DZENOH_DEBUG=3 -H. -Bbuild
make -C build


2 changes: 1 addition & 1 deletion .github/workflows/espidf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install requirements
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/freertos_plus_tcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: jwlawson/[email protected]
- name: Install requirements
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
os: [ ubuntu-latest, macOS-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install latest stable
uses: actions-rs/toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install requirements
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multicast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
os: [macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Compile debug
run: make all
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
name: Preparation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Environment setup
id: env
shell: bash
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
needs: preps
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: MacOS build
run: make
env:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
fail-fast: false
matrix: ${{fromJson(needs.preps.outputs.TARGET_MATRIX)}}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: make for ${{ matrix.target }}
env:
BUILD_TYPE: RELEASE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zephyr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install requirements
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ endif()

if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
if(UNIX)
add_compile_options(-c -Wall -Wextra -Werror -Wunused -Wstrict-prototypes -pipe -g -O0)
add_compile_options(-c -Wall -Wextra -Werror -Wshadow -Wpedantic -Wunused -Wstrict-prototypes -pipe -g -O0)
elseif(MSVC)
add_compile_options(/W4 /WX /Od)
elseif(CMAKE_SYSTEM_NAME MATCHES "Generic")
Expand Down
4 changes: 1 addition & 3 deletions examples/arduino/z_get.ino
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ void loop() {
}
}
#else
void setup() {
Serial.println("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERY but this example requires it.");
}
void setup() { Serial.println("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERY but this example requires it."); }
void loop() {}
#endif
2 changes: 1 addition & 1 deletion examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ void setup() {
Serial.println("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.");
Mallets marked this conversation as resolved.
Show resolved Hide resolved
}
void loop() {}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/espidf/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ void app_main() {
}
#else
void app_main() { printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERY but this example requires it.\n"); }
#endif
#endif
2 changes: 1 addition & 1 deletion examples/espidf/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ void app_main() {
void app_main() {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.\n");
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/espidf/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ void app_main() {
void app_main() {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.\n");
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/include/FreeRTOSIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
#define ipconfigBUFFER_PADDING 14U
#endif

#endif /* FREERTOS_IP_CONFIG_H */
#endif /* FREERTOS_IP_CONFIG_H */
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ void app_main(void) {
void app_main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERY but this example requires it.\n");
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ void app_main(void) {
void app_main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERYABLE but this example requires it.\n");
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/mbed/z_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERY but this example requires it\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/mbed/z_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_PUBLICATION but this example requires it.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/mbed/z_pull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/mbed/z_queryable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERYABLE but this example requires it.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/mbed/z_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.\n");
return -2;
}
#endif
#endif
5 changes: 3 additions & 2 deletions examples/unix/c11/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ int main(int argc, char **argv) {
char c = '\0';
while (1) {
fflush(stdin);
scanf("%c", &c);
int ret = scanf("%c", &c);
Mallets marked this conversation as resolved.
Show resolved Hide resolved
(void)ret; // Remove unused result warning
if (c == 'q') {
break;
}
Expand Down Expand Up @@ -135,4 +136,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERY but this example requires it.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/unix/c11/z_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ int main(void) {
"requires them.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pong.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ int main(void) {
"requires them.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_PUBLICATION but this example requires it.\n");
return -2;
}
#endif
#endif
5 changes: 3 additions & 2 deletions examples/unix/c11/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ int main(int argc, char **argv) {
char c = '\0';
while (1) {
fflush(stdin);
scanf("%c", &c);
int ret = scanf("%c", &c);
(void)ret; // Remove unused result warning
Mallets marked this conversation as resolved.
Show resolved Hide resolved
if (c == 'q') {
break;
}
Expand All @@ -104,4 +105,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.\n");
return -2;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/unix/c11/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_PUBLICATION but this example requires it.\n");
return -2;
}
#endif
#endif
5 changes: 3 additions & 2 deletions examples/unix/c11/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ int main(int argc, char **argv) {
char c = '\0';
while (c != 'q') {
fflush(stdin);
scanf("%c", &c);
int ret = scanf("%c", &c);
(void)ret; // Remove unused result warning
Mallets marked this conversation as resolved.
Show resolved Hide resolved
}

z_undeclare_queryable(z_move(qable));
Expand All @@ -130,4 +131,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_QUERYABLE but this example requires it.\n");
return -2;
}
#endif
#endif
5 changes: 3 additions & 2 deletions examples/unix/c11/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ int main(int argc, char **argv) {
char c = '\0';
while (c != 'q') {
fflush(stdin);
scanf("%c", &c);
int ret = scanf("%c", &c);
(void)ret; // Remove unused result warning
Mallets marked this conversation as resolved.
Show resolved Hide resolved
}

z_undeclare_subscriber(z_move(sub));
Expand All @@ -113,4 +114,4 @@ int main(void) {
printf("ERROR: Zenoh pico was compiled without Z_FEATURE_SUBSCRIPTION but this example requires it.\n");
return -2;
}
#endif
#endif
Loading
Loading