Skip to content

Work in progress: 2022 Mergefest #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ab310ab
Avoid error when no examples directory exists
ianfixes Jan 21, 2021
2f3aee6
Fix documentation about CI
ianfixes Jan 21, 2021
8ac8090
fix naming of github actions
ianfixes Dec 12, 2022
448b7d1
Fix rubocop on Windows #315
ianfixes Dec 17, 2022
ff240bc
note that this project is for libraries
ianfixes Jan 21, 2021
4cc00b9
remove now-incorrect message about library.properties tests in README
ianfixes Jan 21, 2021
cf47379
Restore build_shared_library and fix its bug
ianfixes Dec 12, 2022
6da7797
factor out print_backend_logs
ianfixes Dec 12, 2022
360a87f
Support for checking space usage in compiled sketches via command line
ianfixes Dec 12, 2022
21c3c20
Explicit handling and future-proofing for arduino-cli#753 - config path
ianfixes Dec 17, 2022
5f66151
fixup config path
ianfixes Dec 17, 2022
d4c3fea
Update arduino-cli to 0.29.0
ianfixes Dec 17, 2022
83fd308
Remove flag `--no-dry-run` for `arduino-ci >= 0.14.0`
hf-4145 Mar 5, 2022
1f312ac
Add comments, avoid unnecessary assignments
ianfixes Mar 11, 2022
8e40c59
added arduino nano every config
midasgossye Feb 16, 2021
15ebe86
fixed formatting error
midasgossye Feb 16, 2021
0d245e5
added changelog message
midasgossye Feb 16, 2021
4114f7e
fix test case for nano every
ianfixes Dec 17, 2022
ffc4282
Add guard for library properties path nonexistence
ianfixes Dec 22, 2022
9cb84af
Convert FileUtils to block style
ianfixes Dec 22, 2022
deb0f4e
Better communication about undefined platforms in config
ianfixes Feb 15, 2021
adf4dff
Set all text files to have endings
jgfoster Feb 15, 2021
858c171
print working directory in test output
ianfixes Apr 4, 2021
7694777
Explicitly include irb via rubygems
ianfixes Apr 4, 2021
c1eae26
wrap library spec tests in a context
ianfixes Apr 5, 2021
9c19f86
Fix typo in compiler flag generation
ianfixes Apr 5, 2021
3e8a6cb
allow flexibility in console width
ianfixes Apr 5, 2021
b6e6d3c
Fix compile errors reporting in rspec
ianfixes Apr 5, 2021
e76c402
Avoid ingesting windows pathnames with backslashes -- convert to forw…
ianfixes Apr 5, 2021
afce5ef
Clean up ruby style
ianfixes Dec 22, 2022
cf0dbcd
Ensure that lib installation during tests only happens in pristine dir
ianfixes Dec 24, 2022
cd889d7
Explicit tests for windows-posix path translation
ianfixes Dec 24, 2022
4c6f895
Make config yaml path version-aware
ianfixes Dec 24, 2022
8419a6c
remove unnecessary cleanup
ianfixes Dec 24, 2022
788ca9b
Consider libraries installed if their path is a symlink
ianfixes Dec 24, 2022
8b36a14
Add OS names to tests, stop printing CI backtrace
ianfixes Dec 24, 2022
ba0e4e2
Pin the spelling action version, to match what's enabled in project s…
ianfixes Dec 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# the Git repository itself.

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
* text=auto eol=lf

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout. Git would likely get these right, but
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Check style, functionality, and usage
- name: Check style
run: |
g++ -v
bundle install
bundle exec rubocop --version
bundle exec rubocop -D .

"rspec":
"rspec-linux":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Check style, functionality, and usage
- name: Check functionality
run: |
g++ -v
bundle install
bundle exec rspec --backtrace
bundle exec rspec

"TestSomething":
runs-on: ubuntu-latest
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: TestSomething
- name: Check usage - TestSomething
run: |
g++ -v
bundle install
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Test NetworkLib from scratch
- name: Check usage - Test NetworkLib from scratch
run: |
g++ -v
cd SampleProjects/NetworkLib
Expand All @@ -69,5 +69,5 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Test SharedLibrary should fail
- name: Check usage - Test SharedLibrary should fail
run: ./SampleProjects/SharedLibrary/test.sh
14 changes: 7 additions & 7 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Check style, functionality, and usage
- name: Check style
run: |
g++ -v
bundle install
bundle exec rubocop --version
bundle exec rubocop -D .

"rspec":
"rspec-macos":
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Check style, functionality, and usage
- name: Check functionality
run: |
g++ -v
bundle install
bundle exec rspec --backtrace
bundle exec rspec

"TestSomething":
runs-on: macos-latest
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: TestSomething
- name: Check usage - TestSomething
run: |
g++ -v
bundle install
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Test NetworkLib from scratch
- name: Check usage - Test NetworkLib from scratch
run: |
g++ -v
cd SampleProjects/NetworkLib
Expand All @@ -69,5 +69,5 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Test SharedLibrary should fail
- name: Check usage - Test SharedLibrary should fail
run: ./SampleProjects/SharedLibrary/test.sh
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
fetch-depth: 0

- name: Check Spelling
uses: codespell-project/actions-codespell@master
uses: codespell-project/actions-codespell@v1.0
with:
check_filenames: true
29 changes: 20 additions & 9 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,41 @@ name: windows
on: [push, pull_request]

jobs:
"rubocop_and_rspec":
"rubocop":
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Check style, functionality, and usage
- name: Check style
run: |
g++ -v
bundle install
bundle exec rubocop --version
bundle exec rubocop -D .
echo "done with Rubocop (See https://github.com/Arduino-CI/arduino_ci/issues/315)"
bundle exec rspec --backtrace
bundle exec rubocop -D . --except Layout/EndOfLine

"TestSomething":
"rspec-windows":
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: TestSomething
- name: Check functionality
run: |
g++ -v
bundle install
bundle exec rspec

TestSomething:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Check usage - TestSomething
run: |
g++ -v
bundle install
Expand All @@ -42,7 +53,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Test NetworkLib from scratch
- name: Check usage - Test NetworkLib from scratch
run: |
g++ -v
cd SampleProjects/NetworkLib
Expand All @@ -58,5 +69,5 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Test SharedLibrary should fail
- name: Check usage - Test SharedLibrary should fail
run: ./SampleProjects/SharedLibrary/test.sh
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Support for `dtostrf()`
- Added a CI workflow to lint the code base
- Added a CI workflow to check for spelling errors
- Extraction of byes usage in a compiled sketch is now calculated in a method: `ArduinoBackend.last_bytes_usage`
- Added ```nano_every``` platform to represent ```arduino:megaavr``` architecture
- Working directory is now printed in test runner output
- Explicitly include `irb` via rubygems

### Changed
- We now compile a shared library to be used for each test.
Expand All @@ -22,6 +26,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Update .gitattributes so we have consistent line endings
- Change 266 files from CRLF to LF.
- Run tests on push as well as on a pull request so developers can see impact
- `ArduinoBackend` now exposes `config_file_path` instead of `config_dir` so that we can be explicit about [strange behavior in `arduino-cli` that isn't going to change anytime soon](https://github.com/arduino/arduino-cli/issues/753)
- Use `arduino-cli` version `0.29.0` as the backend
- Test runner detects console width if possible, allowing variable width from 80-132 chars

### Deprecated

Expand All @@ -33,6 +40,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Apply "rule of three" to Client copy constructor and copy assignment operator
- Run Windows tests on Windows not Ubuntu
- Properly report error in building shared library
- A missing `examples` directory no longer causes a crash in `cpp_library.rb`
- Referring to an undefined platform no longer causes a crash; it's now a helpful error message
- A copy/paste error that prevented compiler warning flags from being supplied has been fixed, via jgfoster
- RSpec was not communicating compile errors from unit test executables that failed to build. Now it does, via jgfoster
- Windows paths now avoid picking up backslashes, for proper equality comparisons
- Libraries are now considered installed if their entry is a symlink (for which `exist?` would return `false`)

### Security

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ArduinoCI uses a very standard GitHub workflow.
* 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.

Pull requests will trigger a Travis CI job. The following two commands will be expected to pass (so you may want to run them locally before opening the pull request):
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 tests
* `bundle exec rspec` - functional tests
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
gemspec

gem "bundler", "> 1.15", require: false, group: :test
gem "irb", "~> 1.3.5", require: false
gem "keepachangelog_manager", "~> 0.0.2", require: false, group: :test
gem "rspec", "~> 3.0", require: false, group: :test
gem 'rubocop', '~>1.5.0', require: false, group: :test
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
[![Gitter](https://badges.gitter.im/Arduino-CI/arduino_ci.svg)](https://gitter.im/Arduino-CI/arduino_ci?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![GitHub Marketplace](https://img.shields.io/badge/Get_it-on_Marketplace-informational.svg)](https://github.com/marketplace/actions/arduino_ci)

Arduino CI was created to enable better collaboration among Arduino library maintainers and contributors, by enabling automated code checks to be performed as part of a pull request process.
Arduino CI tests [Arduino libraries](https://arduino.github.io/arduino-cli/library-specification/); it was created to enable better collaboration among Arduino library maintainers and contributors, by enabling automated code checks to be performed as part of a pull request process.

* enables running unit tests against the library **without hardware present**
* provides a system of mocks that allow fine-grained control over the hardware inputs, including the system's clock
* verifies compilation of any example sketches included in the library
* can test a wide range of arduino boards with different hardware options available
* compares entries in `library.properties` to the contents of the library and reports mismatches
* can be run both locally and as part of CI (GitHub Actions, TravisCI, Appveyor, etc.)
* runs on multiple platforms -- any platform that supports the Arduino IDE
* provides detailed analysis of segfaults in compilers that support such debugging features
Expand Down
1 change: 1 addition & 0 deletions SampleProjects/TestSomething/Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
source 'https://rubygems.org'
gem 'arduino_ci', path: '../../'
gem "irb", "~> 1.3.5", require: false
Loading