itead / ITEADLIB_Arduino_Nextion

MIT License
329 stars 320 forks source link

Continuous Integration / Ensure this library can be compiled #45

Open scls19fr opened 7 years ago

scls19fr commented 7 years ago

Hello,

You should ensure that this library can be compiled.

Adding this .travis.yml (or something close to this) is necessary

language: python
python:
    - "2.7"

# Cache PlatformIO packages using Travis CI container-based infrastructure
sudo: false
cache:
    directories:
        - "~/.platformio"

env:
    - PLATFORMIO_CI_SRC=examples/CompButton
    - PLATFORMIO_CI_SRC=examples/CompCrop
    #- PLATFORMIO_CI_SRC=...

install:
    - pip install -U platformio

    # Libraries from PlatformIO Library Registry:
    #- platformio lib -g install ...

script:
    #- platformio ci --board=uno --board=teensy31 --board=due --lib="."
    - platformio ci --board=uno --lib="."

See http://docs.platformio.org/en/latest/ci/travis.html

Adding unit tests could also help to improve quality (but that could be done in a next iteration)

Kind regards

scls19fr commented 6 years ago

https://github.com/ianfixes/arduino_ci can also help

scls19fr commented 5 years ago

In a private project using Arduino and Nextion (this ITEAD library), I enabled continuous integration with arduino_ci. It works fine and ensure that library can be compiled without any error. It can also ensure that unit tests are passing. I'm considering submitting a PR here that enable continuous integration ensuring examples can be compiled (I don't plan to add unit tests in this PR... but maybe later). To achieve this, some files will simply have to be renamed to mach Arduino sketch conventions (see #64 #60), some configuration files will be added (.arduino_ci.yml, .travis.yml and Gemfile)... that's all ! But before doing such a work I wonder if this is something that can be accepted here. if there is no answer, I will not submit a PR but if there is some interest for this, please tell me.

PS : See https://github.com/scls19fr/mwe_arduino_ci for a minimal working example with Arduino and Nextion with CI enabled