Skip to content

Commit

Permalink
feat(eppp): Add simple CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Feb 14, 2024
1 parent cbde47f commit 2db41d4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 14 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/eppp__build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "eppp_link: build-tests"

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]

jobs:
build_eppp:
if: contains(github.event.pull_request.labels.*.name, 'eppp') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest"]
test: [ { app: host, path: "examples/host" }, { app: slave, path: "examples/slave" }, { app: test_app, path: "test" }]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v3
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
shell: bash
working-directory: "components/eppp_link/${{matrix.test.path}}"
run: |
${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh
python $IDF_PATH/tools/ci/ci_build_apps.py . -vv
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ repos:
- repo: local
hooks:
- id: commit message scopes
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common"
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp_link)\)\:)'
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp"
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp)\)\:)'
language: pygrep
args: [--multiline]
stages: [commit-msg]
2 changes: 1 addition & 1 deletion components/eppp_link/.cz.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
commitizen:
bump_message: 'bump(eppp_link): $current_version -> $new_version'
bump_message: 'bump(eppp): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py eppp_link
tag_format: epp_link-v$version
version: 0.0.1
Expand Down
16 changes: 8 additions & 8 deletions components/eppp_link/eppp_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ enum blocked_status {
SLAVE_WANTS_WRITE,
};

static void IRAM_ATTR timer_callback(void *arg)
{
struct eppp_handle *h = arg;
if (h->blocked == SLAVE_WANTS_WRITE) {
gpio_set_level(h->gpio_intr, 0);
}
}

#endif // CONFIG_EPPP_LINK_DEVICE_SPI

struct eppp_handle {
Expand Down Expand Up @@ -128,14 +136,6 @@ static esp_err_t transmit(void *h, void *buffer, size_t len)
return ESP_OK;
}

static void IRAM_ATTR timer_callback(void *arg)
{
struct eppp_handle *h = arg;
if (h->blocked == SLAVE_WANTS_WRITE) {
gpio_set_level(h->gpio_intr, 0);
}
}

static void netif_deinit(esp_netif_t *netif)
{
if (netif == NULL) {
Expand Down
6 changes: 3 additions & 3 deletions components/eppp_link/test/test_app/main/app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ TEST(eppp_test, open_close)
TEST_ASSERT_NOT_NULL(client.netif);

// Now that we're connected, let's try to ping clients address
bits = ping_test(config.ppp.their_ip4_addr, eppp_server, client.event);
bits = ping_test(config.ppp.their_ip4_addr.addr, eppp_server, client.event);
TEST_ASSERT_EQUAL(bits & (PING_SUCCEEDED | PING_FAILED), PING_SUCCEEDED);

// Trigger client disconnection and close the server
Expand Down Expand Up @@ -237,7 +237,7 @@ TEST(eppp_test, open_close_nonblocking)
TEST_ASSERT_EQUAL(bits & wait_bits, wait_bits);

// Now that we're connected, let's try to ping clients address
bits = ping_test(server_config.ppp.their_ip4_addr, eppp_server, event);
bits = ping_test(server_config.ppp.their_ip4_addr.addr, eppp_server, event);
TEST_ASSERT_EQUAL(bits & (PING_SUCCEEDED | PING_FAILED), PING_SUCCEEDED);

// stop network for both client and server
Expand Down Expand Up @@ -304,7 +304,7 @@ TEST(eppp_test, open_close_taskless)
xEventGroupClearBits(info.event, wait_bits);

// Now that we're connected, let's try to ping clients address
bits = ping_test(server_config.ppp.their_ip4_addr, info.eppp_server, info.event);
bits = ping_test(server_config.ppp.their_ip4_addr.addr, info.eppp_server, info.event);
TEST_ASSERT_EQUAL(bits & (PING_SUCCEEDED | PING_FAILED), PING_SUCCEEDED);

// stop network for both client and server, we won't wait for completion so expecting ESP_FAIL
Expand Down

0 comments on commit 2db41d4

Please sign in to comment.