Skip to content
Closed
17 changes: 17 additions & 0 deletions .github/workflows/c-cpp-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: C/C++ CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: build.sh
run: ./build.sh
63 changes: 63 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Unit Tests

on:
pull_request:
# Only run workflow if a file in these paths is modified
paths:
- ".github/workflows/unit-tests.yml"
- "ArduinoCore-API/test/**"
- "ArduinoCore-API/api/**"

push:
paths:
- ".github/workflows/unit-tests.yml"
- "ArduinoCore-API/test/**"
- "ArduinoCore-API/api/**"

jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest

env:
COVERAGE_DATA_PATH: extras/coverage-data/coverage.info

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Create link to String.h
run: echo '#include "WString.h"' > ArduinoCore-API/api/String.h

- name: Create link to String.cpp
run: echo '#include "WString.cpp"' > ArduinoCore-API/api/String.cpp

- name: Fix catch lib issues
run: echo 'add_compile_definitions(CATCH_CONFIG_NO_POSIX_SIGNALS)' >> ArduinoCore-API/test/CMakeLists.txt

- name: Relax some warings
# run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt
# run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt
# run: echo 'add_compile_options(-Wno-error=unused-function)' >> ArduinoCore-API/test/CMakeLists.txt
run: sed -i 's/-Werror//g' ArduinoCore-API/test/CMakeLists.txt


# See: https://github.com/arduino/cpp-test-action/blob/main/README.md
- uses: arduino/cpp-test-action@main
with:
source-path: ArduinoCore-API/test
build-path: ArduinoCore-API/test/build
runtime-path: ArduinoCore-API/test/build/bin/test-ArduinoCore-API
coverage-exclude-paths: |
- '*/test/*'
- '/usr/*'
coverage-data-path: ${{ env.COVERAGE_DATA_PATH }}

# Temporary excluded to prevent token requirement
# See: https://github.com/codecov/codecov-action/blob/master/README.md
#- name: Code coverage
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ${{ env.COVERAGE_DATA_PATH }}
# fail_ci_if_error: true
3 changes: 2 additions & 1 deletion ArduinoCore-Linux/cores/arduino/WiFiClientSecure.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#if defined(USE_HTTPS)
#include <wolfssl/ssl.h>
#include "Ethernet.h"

namespace arduino {

Expand Down Expand Up @@ -56,7 +57,7 @@ class SocketImplSecure : public SocketImpl {
class WiFiClientSecure : public EthernetClient {
public:
WiFiClientSecure(int bufferSize = 256, long timeout = 2000)
: EthernetClient(bufferSize, timeout, new SocketImplSecure()) {}
: EthernetClient(SocketImplSecure { }, bufferSize, timeout) {}
};

} // namespace arduino
Expand Down
Loading