Skip to content

Commit

Permalink
Build with both clang and gcc on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
infertux committed Mar 24, 2024
1 parent 8438603 commit 179cd96
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,27 @@ permissions:

jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true # FIXME: remove when gcc build is passing
strategy:
fail-fast: false
matrix:
cc: [clang, gcc]
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ${{ matrix.cc }} libbsd-dev libconfig-dev libmodbus-dev libmosquitto-dev
- name: make with ${{ matrix.cc }}
run: env CC=${{ matrix.cc }} make
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang libbsd-dev libconfig-dev libmodbus-dev libmosquitto-dev mosquitto-clients
- name: make
run: make
- name: make lint
run: make lint
run: env CC=clang make lint
- name: make test
run: make test
run: env CC=clang make test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Would like to monitor Epever/Epsolar Tracer solar charge controllers instead? He

- Blog post: https://www.splitbrain.org/blog/2023-11/03-growatt_and_home_assistant
- Reading Modbus registers via Home Assistant: https://github.com/home-assistant/core/issues/94149
- https://github.com/rspring/Esphome-Growatt

## License

Expand Down
4 changes: 1 addition & 3 deletions src/modbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ int query_modbus(modbus_t *ctx) {
return device_metrics.read_metric_succeeded_total == 0 ? EXIT_NO_METRICS : EXIT_SUCCESS;
}

static void stop_modbus_thread(void) {
modbus_close(ctx);
}
static void stop_modbus_thread(void) { modbus_close(ctx); }

int start_modbus_thread(char device_or_uri[static 1]) {
LOG(LOG_DEBUG, "Modbus thread running...");
Expand Down

0 comments on commit 179cd96

Please sign in to comment.