Arduino-CI / arduino_ci

Unit testing and Continuous Integration (CI) for Arduino libraries, from a Ruby gem
Apache License 2.0
110 stars 34 forks source link

Offer an `install.sh`-style script for one-liner integration in CI config #42

Open ianfixes opened 6 years ago

ianfixes commented 6 years ago

Feature Request

Bundle an install.sh script (e.g. https://github.com/adafruit/travis-ci-arduino/blob/master/install.sh) such that Gemfile doesn't need to be added to a project.

Add a sample project called TrustSomething to verify that it works.

before_install:
  - source <(curl -SLs https://raw.githubusercontent.com/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/install.sh)

script:
   - something_something_defined_in_install_sh
ianfixes commented 6 years ago

Now that I've had some time to think about implementing this, I'm not so sure it's a good idea.

The value of the Adafruit install.sh script is that it enables you to compile sketches on CI. With one line of code, you can have the CI machine perform the same steps that you would perform in your development environment: compiling the sketches.

Creating my own install.sh would be fairly trivial, but that would set up a situation where the CI machine has a capability that you don't have on your local machine -- the ability to run unit tests.
This means that the development cycle for unit tests would be:

  1. making a change to the codebase

  2. committing the change

  3. pushing the commit to GitHub

  4. waiting for the CI machine to pick up the job

  5. waiting for the CI machine to do the initial download of all the Arduino stuff

  6. have the CI machine execute unit tests

  7. wait for the results to appear, either in the CI console log or a GitHub notification

    It seems much more sensible to just download the unit testing capability to your own machine and then just:

  8. make a change to the codebase

  9. run the unit tests locally (with the same command that the CI machine will use)

Is there a use case I'm not considering here?