ArduinoCI uses a very standard GitHub workflow.
- Fork the repository on github
- Make your desired changes on top of the latest
master
branch, document them in CHANGELOG.md - Push to your personal fork
- Open a pull request
- If you are submitting code, use
master
as the base branch - If you are submitting broken unit tests (illustrating a bug that should be fixed), use
tdd
as the base branch.
- If you are submitting code, use
Pull requests will trigger a CI job. The following two commands will be expected to pass (so you may want to run them locally before opening the pull request):
bundle exec rubocop -D .
- code style testsbundle exec rspec
- functional testsbundle exec rspec spec/some_file_spec.rb
- functional tests for just some file
If you do not already have a working ruby development environment set up, run the following commands:
# One of the following
apt-get install ruby ruby-dev # For Debian/Ubuntu
dnf install ruby ruby-devel # For Fedora/newer Centos/RHEL
yum install ruby ruby-devel # For older Centos/RHEL
# All below
gem install bundler
gem install rspec
# Now you are ready to install dependencies with bundle (as described in the
# README file) and to run unit tests.
Be prepared to write tests to accompany any code you would like to see merged.
See SampleProjects/TestSomething/test/*.cpp
for the existing tests (run by rspec).
To speed up testing by targeting only the files you're working on, you can set several environment variables that bundle exec rspec
will respond to:
ARDUINO_CI_SKIP_RUBY_RSPEC_TESTS
: if set, this will skip all tests against ruby code (useful if you are not changing Ruby code).ARDUINO_CI_SKIP_CPP_RSPEC_TESTS
: if set, this will skip all tests against theTestSomething
sample project (useful if you are not changing C++ code).ARDUINO_CI_SELECT_CPP_TESTS=<glob>
: if set, this will skip all C++ unit tests whose filenames don't match the provided glob (executed in the tests directory)
Example usage:
ARDUINO_CI_SKIP_RUBY_RSPEC_TESTS=1 bundle exec rspec
- Merge pull request with new features
- Execute
release-new-version.sh
with the appropriate argument (e.g.--increment-patch
), which does the following:git stash save
(at least before the gem build step, but easiest here).git pull --rebase
- Update the sections of
CHANGELOG.md
by runningbundle exec keepachangelog_manager.rb --increment-patch
- Bump the version in lib/arduino_ci/version.rb and change it in README.md (since rubydoc.info doesn't always redirect to the latest version)
git add README.md CHANGELOG.md lib/arduino_ci/version.rb
git commit -m "vVERSION bump"
git tag -a vVERSION -m "Released version VERSION"
gem build arduino_ci.gemspec
git stash pop
gem push arduino_ci-VERSION.gem
git push upstream
git push upstream --tags
- Visit http://www.rubydoc.info/gems/arduino_ci/VERSION to initiate the doc generation process