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

Migrate to GitHub workflow #82

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
93 changes: 0 additions & 93 deletions .circleci/config.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: syntax, static code analyis and build check for c drivers

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: cppcheck clang-format
version: 1.0
- name: clang-format syntax-check
run: |
find sht-common -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find shtc1 -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find sht3x -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find sht4x -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
git diff --exit-code
- name: cppcheck static code analyis
run: cppcheck --std=c89 --language=c --error-exitcode=1 --enable=warning,style,performance,portability --suppress=unreadVariable -i sample-projects/ -i embedded-common/ -i release/ .
34 changes: 0 additions & 34 deletions .gitlab-ci.yml

This file was deleted.

3 changes: 1 addition & 2 deletions sht3x/sht3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,12 @@ void sht3x_set_power_mode(sht3x_measurement_mode_t mode) {

int16_t sht3x_read_serial(sht3x_i2c_addr_t addr, uint32_t* serial) {
int16_t ret;
uint8_t serial_bytes[4];

ret = sensirion_i2c_write_cmd(addr, SHT3X_CMD_READ_SERIAL_ID);
sensirion_sleep_usec(SHT3X_CMD_DURATION_USEC);

if (ret == STATUS_OK) {

uint8_t serial_bytes[4];
ret = sensirion_i2c_read_words_as_bytes(
addr, serial_bytes, SENSIRION_NUM_WORDS(serial_bytes));
*serial = sensirion_bytes_to_uint32_t(serial_bytes);
Expand Down
2 changes: 1 addition & 1 deletion shtc1/shtc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int16_t shtc1_read_serial(uint32_t* serial) {
return ret;

*serial = ((uint32_t)serial_words[0] << 16) | serial_words[1];
return ret;
return 0;
}

const char* shtc1_get_driver_version(void) {
Expand Down