diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a82d7b5..17470a6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,8 +9,8 @@ jobs: env: PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.9' - name: Install PlatformIO Core diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 041ed11..5bfbe9a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,8 +10,8 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cache/pip @@ -26,3 +26,9 @@ jobs: pip install platformio - name: Run Tests on the Desktop Environment run: platformio test -e desktop + - name: Run Build Test for Arduino Uno + run: platformio run -e arduino_uno -t build_test.cpp + - name: Run Build Test for ESP32 Dev Module + run: platformio run -e esp32dev -t build_test.cpp + + diff --git a/build_test.cpp b/build_test.cpp new file mode 100644 index 0000000..99e2ecf --- /dev/null +++ b/build_test.cpp @@ -0,0 +1,42 @@ +// Include lib: +#include +#include + +// Create an Arithmetic Moving Average object of unsigned int type, +// 10 in size +DataTomeMvAvg test(10); +DataTomeAnalysis test2(10); +// DataTomeExpAvg test3(10); + +// This variable just generates input for average test +unsigned delta_x = 0; + +void setup() { + // Initialize serial interface + Serial.begin(9600); +} + +void loop() { + // Pushes the input in the moving average object + test.push(delta_x); + + // Generates the next input + delta_x += 5; + if (delta_x > 1000) delta_x = 0; + + // Prints each value stored in the moving average + for (uint8_t i = 0; i < test.size(); i++) { + Serial.print(test[i]); + Serial.print(" "); + } + // Prints the result of the average + Serial.print("= "); + Serial.print(test.get()); + // Prints the value stored in the first and last indexes + Serial.print(" | f: "); + Serial.print(test.front()); + Serial.print(" b: "); + Serial.println(test.back()); + + delay(1000); +}