Skip to content

Empty examples folder causes build to fail #324

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

Closed
RobTillaart opened this issue May 24, 2022 · 2 comments · Fixed by #334
Closed

Empty examples folder causes build to fail #324

RobTillaart opened this issue May 24, 2022 · 2 comments · Fixed by #334

Comments

@RobTillaart
Copy link

System

https://github.com/RobTillaart/RS485/runs/6576256743?check_suite_focus=true

================================================================================
Beginning the next phase of testing...           Compilation of example sketches
/opt/hostedtoolcache/Ruby/2.6.10/x64/lib/ruby/gems/2.6.0/gems/arduino_ci-1.3.0/lib/arduino_ci/cpp_library.rb:135:in `example_sketches': undefined method `map' for nil:NilClass (NoMethodError)
	from /opt/hostedtoolcache/Ruby/2.6.10/x64/lib/ruby/gems/2.6.0/gems/arduino_ci-1.3.0/exe/arduino_ci.rb:450:in `perform_example_compilation_tests'
	from /opt/hostedtoolcache/Ruby/2.6.10/x64/lib/ruby/gems/2.6.0/gems/arduino_ci-1.3.0/exe/arduino_ci.rb:536:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/2.6.10/x64/bin/arduino_ci.rb:23:in `load'
	from /opt/hostedtoolcache/Ruby/2.6.10/x64/bin/arduino_ci.rb:23:in `<main>'
Error: Process completed with exit code 1.

(Issue Summary / Feature Request)

While pushing a new library to github without examples, the build CI fails on "missing" examples.
expected success as there are no compilation errors, or maybe better a warning "NO EXAMPLES FOUND!!!"

Arduino or Unit Test Code, Illustrating the Problem

See link above

Arduino Architecture(s) Affected

All

@RobTillaart
Copy link
Author

Any idea if this will be fixed?

@RobTillaart
Copy link
Author

https://github.com/Arduino-CI/arduino_ci/blob/master/exe/arduino_ci.rb

change these lines 470-476

  library_examples = cpp_library.example_sketches

  if library_examples.empty?
    handle_expectation_of_files(VAR_EXPECT_EXAMPLES, "builds", "examples", "the examples directory", cpp_library.examples_dir)
    return
  end

to something like

  library_examples = cpp_library.example_sketches

  if library_examples.empty?
    inform("Skipping compilation of examples") { "as these do not exist. Preferably you should at least add one." }
    return
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant