Skip to content

Commit 5cac675

Browse files
author
James Foster
authored
Merge branch 'master' into Client_assignment_operator
2 parents 23c3670 + 115eb01 commit 5cac675

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed

.github/workflows/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ In this project, we define a workflow for each target platform. **If you're loo
77

88
The reason that all platforms are tested in _this_ project is to ensure that, as a framework, `arduino_ci` will run properly on any developer's personal workstation (regardless of OS).
99

10-
For testing an individual Arduino library in the context of GitHub, [Linux is the cheapest option](https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions) and produces results identical to the other OSes.
10+
For testing an individual Arduino library in the context of GitHub, [Linux is the cheapest option](https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions) and should produce results identical to the other OSes.

.github/workflows/linux.yaml

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

4-
on: [pull_request]
4+
on: [push, pull_request]
55

66
jobs:
77
"unittest_lint_sampleproject":

.github/workflows/macos.yaml

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

4-
on: [pull_request]
4+
on: [push, pull_request]
55

66
jobs:
77
"unittest_lint_sampleproject":

.github/workflows/windows.yaml

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

4-
on: [pull_request]
4+
on: [push, pull_request]
55

66
jobs:
77
"unittest_lint_sampleproject":

CHANGELOG.md

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

88
## [Unreleased]
99
### Added
10+
- Show output from successful compile
11+
- `--min-free-space=N` command-line argument to fail if free space is below requred value
1012

1113
### Changed
1214
- Change 266 files from CRLF to LF.
15+
- Run tests on push as well as on a pull request so developers can see impact
1316
- Apply "rule of three" to Client copy constructor and copy assignment operator
1417

1518
### Deprecated

exe/arduino_ci.rb

+17-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def self.parse(options)
2424
ci_config: {
2525
"unittest" => unit_config
2626
},
27+
min_free_space: 0,
2728
}
2829

2930
opt_parser = OptionParser.new do |opts|
@@ -49,6 +50,10 @@ def self.parse(options)
4950
unit_config["testfiles"]["reject"] << p
5051
end
5152

53+
opts.on("--min-free-space=VALUE", "Minimum free SRAM memory for stack/heap") do |p|
54+
output_options[:min_free_space] = p.to_i
55+
end
56+
5257
opts.on("-h", "--help", "Prints this help") do
5358
puts opts
5459
puts
@@ -478,8 +483,18 @@ def perform_example_compilation_tests(cpp_library, config)
478483
board = ovr_config.platform_info[p][:board]
479484
attempt("Compiling #{example_name} for #{board}") do
480485
ret = @backend.compile_sketch(example_path, board)
481-
unless ret
482-
puts
486+
puts
487+
if ret
488+
output = @backend.last_msg
489+
puts output
490+
i = output.index("leaving")
491+
free_space = output[i + 8..-1].to_i
492+
min_free_space = @cli_options[:min_free_space]
493+
if free_space < min_free_space
494+
puts "Free space of #{free_space} is less than minimum of #{min_free_space}"
495+
ret = false
496+
end
497+
else
483498
puts "Last command: #{@backend.last_msg}"
484499
puts @backend.last_err
485500
end

lib/arduino_ci/arduino_backend.rb

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def compile_sketch(path, boardname)
164164
return false
165165
end
166166
ret = run_and_capture("compile", "--fqbn", boardname, "--warnings", "all", "--dry-run", path.to_s)
167+
@last_msg = ret[:out]
167168
ret[:success]
168169
end
169170

0 commit comments

Comments
 (0)