Skip to content

Commit 03973f0

Browse files
authored
Merge pull request #232 from Arduino-CI/2020-12-01_fixes
Fixes for GitHub Action
2 parents a1139a2 + 89d5a81 commit 03973f0

18 files changed

+227
-240
lines changed

.github/workflows/linux.yaml

+5-36
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,23 @@
11
# This is the name of the workflow, visible on GitHub UI
22
name: linux
33

4-
# Run on a Push or a Pull Request
5-
on: [push, pull_request]
4+
on: [pull_request]
65

76
jobs:
8-
rspec:
7+
"unittest_lint_sampleproject":
98
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v2
1211
- uses: ruby/setup-ruby@v1
1312
with:
1413
ruby-version: 2.6
15-
16-
# Install and run Arduino CI tests for rspec
17-
- name: Build and Execute
14+
- name: Check style, funcionality, and usage
1815
run: |
1916
g++ -v
20-
bundle install
21-
bundle exec rspec --backtrace
22-
23-
rubocop:
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@v2
27-
- uses: ruby/setup-ruby@v1
28-
with:
29-
ruby-version: 2.6
30-
31-
# Install and run Arduino CI tests for rubocop
32-
- name: Build and Execute
33-
run: |
3417
bundle install
3518
bundle exec rubocop --version
3619
bundle exec rubocop -D .
37-
38-
TestSomething:
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v2
42-
- uses: ruby/setup-ruby@v1
43-
with:
44-
ruby-version: 2.6
45-
46-
# Install and run Arduino CI tests for TestSomething
47-
- name: Build and Execute
48-
run: |
49-
g++ -v
20+
bundle exec rspec --backtrace
5021
cd SampleProjects/TestSomething
5122
bundle install
5223
bundle exec arduino_ci.rb
@@ -58,9 +29,7 @@ jobs:
5829
- uses: ruby/setup-ruby@v1
5930
with:
6031
ruby-version: 2.6
61-
62-
# Install and run Arduino CI tests for NetworkLib
63-
- name: Build and Execute
32+
- name: Test NetworkLib from scratch
6433
run: |
6534
g++ -v
6635
cd SampleProjects/NetworkLib

.github/workflows/macos.yaml

+5-36
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,23 @@
11
# This is the name of the workflow, visible on GitHub UI
22
name: macos
33

4-
# Run on a Push or a Pull Request
5-
on: [push, pull_request]
4+
on: [pull_request]
65

76
jobs:
8-
rspec:
7+
"unittest_lint_sampleproject":
98
runs-on: macos-latest
109
steps:
1110
- uses: actions/checkout@v2
1211
- uses: ruby/setup-ruby@v1
1312
with:
1413
ruby-version: 2.6
15-
16-
# Install and run Arduino CI tests for rspec
17-
- name: Build and Execute
14+
- name: Check style, funcionality, and usage
1815
run: |
1916
g++ -v
20-
bundle install
21-
bundle exec rspec --backtrace
22-
23-
rubocop:
24-
runs-on: macos-latest
25-
steps:
26-
- uses: actions/checkout@v2
27-
- uses: ruby/setup-ruby@v1
28-
with:
29-
ruby-version: 2.6
30-
31-
# Install and run Arduino CI tests for rubocop
32-
- name: Build and Execute
33-
run: |
3417
bundle install
3518
bundle exec rubocop --version
3619
bundle exec rubocop -D .
37-
38-
TestSomething:
39-
runs-on: macos-latest
40-
steps:
41-
- uses: actions/checkout@v2
42-
- uses: ruby/setup-ruby@v1
43-
with:
44-
ruby-version: 2.6
45-
46-
# Install and run Arduino CI tests for TestSomething
47-
- name: Build and Execute
48-
run: |
49-
g++ -v
20+
bundle exec rspec --backtrace
5021
cd SampleProjects/TestSomething
5122
bundle install
5223
bundle exec arduino_ci.rb
@@ -58,9 +29,7 @@ jobs:
5829
- uses: ruby/setup-ruby@v1
5930
with:
6031
ruby-version: 2.6
61-
62-
# Install and run Arduino CI tests for NetworkLib
63-
- name: Build and Execute
32+
- name: Test NetworkLib from scratch
6433
run: |
6534
g++ -v
6635
cd SampleProjects/NetworkLib

.github/workflows/windows.yaml

+7-38
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,35 @@
11
# This is the name of the workflow, visible on GitHub UI
22
name: windows
33

4-
# Run on a Push or a Pull Request
5-
on: [push, pull_request]
4+
on: [pull_request]
65

76
jobs:
8-
rspec:
9-
runs-on: windows-latest
7+
"unittest_lint_sampleproject":
8+
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v2
1211
- uses: ruby/setup-ruby@v1
1312
with:
1413
ruby-version: 2.6
15-
16-
# Install and run Arduino CI tests for rspec
17-
- name: Build and Execute
14+
- name: Check style, funcionality, and usage
1815
run: |
1916
g++ -v
20-
bundle install
21-
bundle exec rspec --backtrace
22-
23-
rubocop:
24-
runs-on: windows-latest
25-
steps:
26-
- uses: actions/checkout@v2
27-
- uses: ruby/setup-ruby@v1
28-
with:
29-
ruby-version: 2.6
30-
31-
# Install and run Arduino CI tests for rubocop
32-
- name: Build and Execute
33-
run: |
3417
bundle install
3518
bundle exec rubocop --version
3619
bundle exec rubocop -D .
37-
38-
TestSomething:
39-
runs-on: windows-latest
40-
steps:
41-
- uses: actions/checkout@v2
42-
- uses: ruby/setup-ruby@v1
43-
with:
44-
ruby-version: 2.6
45-
46-
# Install and run Arduino CI tests for TestSomething
47-
- name: Build and Execute
48-
run: |
49-
g++ -v
20+
bundle exec rspec --backtrace
5021
cd SampleProjects/TestSomething
5122
bundle install
5223
bundle exec arduino_ci.rb
5324
5425
NetworkLib:
55-
runs-on: windows-latest
26+
runs-on: ubuntu-latest
5627
steps:
5728
- uses: actions/checkout@v2
5829
- uses: ruby/setup-ruby@v1
5930
with:
6031
ruby-version: 2.6
61-
62-
# Install and run Arduino CI tests for Network
63-
- name: Build and Execute
32+
- name: Test NetworkLib from scratch
6433
run: |
6534
g++ -v
6635
cd SampleProjects/NetworkLib

.rubocop.yml

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
AllCops:
2+
TargetRubyVersion: 2.6
3+
NewCops: enable
4+
SuggestExtensions: false
25
Exclude:
36
- '*.gemspec'
47
- 'spec/*.rb'
@@ -13,6 +16,24 @@ Style/RescueStandardError:
1316
Security/Open:
1417
Enabled: false
1518

19+
Style/FrozenStringLiteralComment:
20+
Enabled: false
21+
22+
# broken :( https://github.com/rubocop-hq/rubocop/issues/9144
23+
Style/StringConcatenation:
24+
Enabled: false
25+
26+
# Ruins git diffs
27+
Style/AccessorGrouping:
28+
Enabled: false
29+
30+
# Ruins keeping the upper half of the conditional smaller
31+
Style/NegatedIfElseCondition:
32+
Enabled: false
33+
34+
# affects calling style?
35+
Style/OptionalBooleanParameter:
36+
Enabled: false
1637

1738
# Extra lines for readability
1839
Layout/EmptyLinesAroundClassBody:
@@ -37,9 +58,7 @@ Layout/EndAlignment:
3758
Layout/CaseIndentation:
3859
EnforcedStyle: end
3960

40-
Metrics/LineLength:
41-
Description: Limit lines to 80 characters.
42-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
61+
Layout/LineLength:
4362
Enabled: true
4463
Max: 130
4564

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

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

1113
### Changed
14+
- Conserve CI testing minutes by grouping CI into fewer runs
1215

1316
### Deprecated
1417

1518
### Removed
1619

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

1924
### Security
2025

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ gemspec
88
gem "bundler", "> 1.15", require: false, group: :test
99
gem "keepachangelog_manager", "~> 0.0.2", require: false, group: :test
1010
gem "rspec", "~> 3.0", require: false, group: :test
11-
gem 'rubocop', '~>0.59.0', require: false, group: :test
11+
gem 'rubocop', '~>1.5.0', require: false, group: :test
1212
gem 'simplecov', require: false, group: :test
1313
gem 'yard', '~>0.9.11', require: false, group: :test

REFERENCE.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,22 @@ This completely skips the compilation tests (of library examples) portion of the
3333

3434
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`.
3535

36+
3637
### `--testfile-reject` option
3738

3839
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.
3940

4041

42+
### `EXPECT_UNITTESTS` environment variable
43+
44+
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.
45+
46+
47+
### `EXPECT_EXAMPLES` environment variable
48+
49+
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.
50+
51+
4152
## Indirectly Overriding Build Behavior (medium term use), and Advanced Options
4253

4354
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:
@@ -53,7 +64,7 @@ For build behavior that you'd like to persist across commits (e.g. defining the
5364

5465
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
5566

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

5869
```yaml
5970
packages:

0 commit comments

Comments
 (0)