Skip to content

Fixes for GitHub Action #232

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 9 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 5 additions & 36 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,23 @@
# This is the name of the workflow, visible on GitHub UI
name: linux

# Run on a Push or a Pull Request
on: [push, pull_request]
on: [pull_request]

jobs:
rspec:
"unittest_lint_sampleproject":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for rspec
- name: Build and Execute
- name: Check style, funcionality, and usage
run: |
g++ -v
bundle install
bundle exec rspec --backtrace

rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for rubocop
- name: Build and Execute
run: |
bundle install
bundle exec rubocop --version
bundle exec rubocop -D .

TestSomething:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for TestSomething
- name: Build and Execute
run: |
g++ -v
bundle exec rspec --backtrace
cd SampleProjects/TestSomething
bundle install
bundle exec arduino_ci.rb
Expand All @@ -58,9 +29,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for NetworkLib
- name: Build and Execute
- name: Test NetworkLib from scratch
run: |
g++ -v
cd SampleProjects/NetworkLib
Expand Down
41 changes: 5 additions & 36 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,23 @@
# This is the name of the workflow, visible on GitHub UI
name: macos

# Run on a Push or a Pull Request
on: [push, pull_request]
on: [pull_request]

jobs:
rspec:
"unittest_lint_sampleproject":
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for rspec
- name: Build and Execute
- name: Check style, funcionality, and usage
run: |
g++ -v
bundle install
bundle exec rspec --backtrace

rubocop:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for rubocop
- name: Build and Execute
run: |
bundle install
bundle exec rubocop --version
bundle exec rubocop -D .

TestSomething:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for TestSomething
- name: Build and Execute
run: |
g++ -v
bundle exec rspec --backtrace
cd SampleProjects/TestSomething
bundle install
bundle exec arduino_ci.rb
Expand All @@ -58,9 +29,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for NetworkLib
- name: Build and Execute
- name: Test NetworkLib from scratch
run: |
g++ -v
cd SampleProjects/NetworkLib
Expand Down
45 changes: 7 additions & 38 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,35 @@
# This is the name of the workflow, visible on GitHub UI
name: windows

# Run on a Push or a Pull Request
on: [push, pull_request]
on: [pull_request]

jobs:
rspec:
runs-on: windows-latest
"unittest_lint_sampleproject":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for rspec
- name: Build and Execute
- name: Check style, funcionality, and usage
run: |
g++ -v
bundle install
bundle exec rspec --backtrace

rubocop:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for rubocop
- name: Build and Execute
run: |
bundle install
bundle exec rubocop --version
bundle exec rubocop -D .

TestSomething:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for TestSomething
- name: Build and Execute
run: |
g++ -v
bundle exec rspec --backtrace
cd SampleProjects/TestSomething
bundle install
bundle exec arduino_ci.rb

NetworkLib:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Install and run Arduino CI tests for Network
- name: Build and Execute
- name: Test NetworkLib from scratch
run: |
g++ -v
cd SampleProjects/NetworkLib
Expand Down
25 changes: 22 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
AllCops:
TargetRubyVersion: 2.6
NewCops: enable
SuggestExtensions: false
Exclude:
- '*.gemspec'
- 'spec/*.rb'
Expand All @@ -13,6 +16,24 @@ Style/RescueStandardError:
Security/Open:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

# broken :( https://github.com/rubocop-hq/rubocop/issues/9144
Style/StringConcatenation:
Enabled: false

# Ruins git diffs
Style/AccessorGrouping:
Enabled: false

# Ruins keeping the upper half of the conditional smaller
Style/NegatedIfElseCondition:
Enabled: false

# affects calling style?
Style/OptionalBooleanParameter:
Enabled: false

# Extra lines for readability
Layout/EmptyLinesAroundClassBody:
Expand All @@ -37,9 +58,7 @@ Layout/EndAlignment:
Layout/CaseIndentation:
EnforcedStyle: end

Metrics/LineLength:
Description: Limit lines to 80 characters.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
Layout/LineLength:
Enabled: true
Max: 130

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- `ensure_arduino_installation.rb` now ensures the existence of the library directory as well
- Environment variables to escalate unit tests or examples not being found during CI testing

### Changed
- Conserve CI testing minutes by grouping CI into fewer runs

### Deprecated

### Removed

### Fixed
- Improper reference to `Host` in `arduino_ci.rb` test runner is now properly qualified
- Failure to set board manager URLs (for 3rd party board providers) has been fixed

### Security

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ gemspec
gem "bundler", "> 1.15", require: false, group: :test
gem "keepachangelog_manager", "~> 0.0.2", require: false, group: :test
gem "rspec", "~> 3.0", require: false, group: :test
gem 'rubocop', '~>0.59.0', require: false, group: :test
gem 'rubocop', '~>1.5.0', require: false, group: :test
gem 'simplecov', require: false, group: :test
gem 'yard', '~>0.9.11', require: false, group: :test
13 changes: 12 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,22 @@ This completely skips the compilation tests (of library examples) portion of the

This allows a file (or glob) pattern to be executed in your tests directory, creating a whitelist of files to test. E.g. `--testfile-select=test_animal_*.cpp` would match `test_animal_cat.cpp` and `test_animal_dog.cpp` (testing only those) and not `test_plant_rose.cpp`.


### `--testfile-reject` option

This allows a file (or glob) pattern to be executed in your tests directory, creating a blacklist of files to skip. E.g. `--testfile-reject=test_animal_*.cpp` would match `test_animal_cat.cpp` and `test_animal_dog.cpp` (skipping those) and test only `test_plant_rose.cpp`, `test_plant_daisy.cpp`, etc.


### `EXPECT_UNITTESTS` environment variable

If set, testing will fail if no unit test files are detected (or if the directory does not exist). This is to avoid communicating a passing status in cases where a commit may have accidentally moved or deleted the test files.


### `EXPECT_EXAMPLES` environment variable

If set, testing will fail if no example sketches are detected. This is to avoid communicating a passing status in cases where a commit may have accidentally moved or deleted the examples.


## Indirectly Overriding Build Behavior (medium term use), and Advanced Options

For build behavior that you'd like to persist across commits (e.g. defining the set of platforms to test against, disabling a test that you expect to re-enable at some future point), a special configuration file called `.arduino-ci.yml` can be used. There are 3 places you can put them:
Expand All @@ -53,7 +64,7 @@ For build behavior that you'd like to persist across commits (e.g. defining the

Arduino boards are typically named in the form `manufacturer:family:model`. These definitions are not arbitrary -- they are defined in an Arduino _package_. For all but the built-in packages, you will need a package URL. Here is Adafruit's: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Here is how you would declare a package that includes the `potato:salad` family of boards in your `.arduino-ci.yml`:
Here is how you would declare a package that includes the `potato:salad` set of platforms (aka "board family") in your `.arduino-ci.yml`:

```yaml
packages:
Expand Down
Loading