Skip to content

NoMethodError: undefined method `map' for nil:NilClass #295

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
QuentinN42 opened this issue Apr 1, 2021 · 6 comments · Fixed by #334
Closed

NoMethodError: undefined method `map' for nil:NilClass #295

QuentinN42 opened this issue Apr 1, 2021 · 6 comments · Fixed by #334
Labels
bug Something isn't working ci scripts The test runner scripts

Comments

@QuentinN42
Copy link

Running Arduino-CI/[email protected] result in NoMethodError :

I use the default workflow :

name: Arduino_CI

on: [pull_request]

jobs:
  arduino_ci:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: Arduino-CI/[email protected]

And my project is ok for arduino-lint action :

CI-test/
├── CI-test.ino
├── examples
│   └── example.c
├── README.md
└── test
    └── test.c

But I have always this issue :

================================================================================
Beginning the next phase of testing...           Compilation of example sketches
bundler: failed to load command: /action/bundle/ruby/2.6.0/bin/arduino_ci.rb (/action/bundle/ruby/2.6.0/bin/arduino_ci.rb)
NoMethodError: undefined method `map' for nil:NilClass
  /action/bundle/ruby/2.6.0/gems/arduino_ci-1.3.0/lib/arduino_ci/cpp_library.rb:135:in `example_sketches'
  /action/bundle/ruby/2.6.0/gems/arduino_ci-1.3.0/exe/arduino_ci.rb:450:in `perform_example_compilation_tests'
  /action/bundle/ruby/2.6.0/gems/arduino_ci-1.3.0/exe/arduino_ci.rb:536:in `<top (required)>'
  /action/bundle/ruby/2.6.0/bin/arduino_ci.rb:23:in `load'
  /action/bundle/ruby/2.6.0/bin/arduino_ci.rb:23:in `<top (required)>'
@QuentinN42
Copy link
Author

Ok solved, just follow the structure of an arduino porject inside examples :
Sample project examples

@ianfixes
Copy link
Collaborator

ianfixes commented Apr 3, 2021

Hi @QuentinN42, thanks for reporting this! Even though your structure may not have been correct, that's no reason for the arduino_ci runner to crash.

I think I may have encountered this and fixed it locally, but I am going to reopen your issue until I get it into a pull request.

@ianfixes ianfixes reopened this Apr 3, 2021
@ianfixes ianfixes added bug Something isn't working ci scripts The test runner scripts labels Apr 3, 2021
@QuentinN42
Copy link
Author

I think the bug come from line 135 of /lib/arduino_ci/cpp_library.rb :
If info["library"]["examples"] is nil map will crash.

PS : I don't code in ruby, just fluent in stackoverflow 😄.

@ianfixes
Copy link
Collaborator

ianfixes commented Apr 4, 2021

Yup, I have it here 7607915

@QuentinN42
Copy link
Author

Nice !
When do you think this will be merged into a stable release ?

@ianfixes
Copy link
Collaborator

ianfixes commented Apr 5, 2021

I just want to get the config overrides done as part of https://github.com/Arduino-CI/arduino_ci/milestone/11 and then I should be in good shape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci scripts The test runner scripts
Projects
None yet
2 participants