Arduino-CI / action

GitHub action to run Arduino CI
16 stars 3 forks source link

Arduino CI failing without clear error #20

Closed midasgossye closed 3 years ago

midasgossye commented 3 years ago

Hey guys,

I just tried using the Arduino CI action on an Arduino library I wrote (github.com/Whaddadraft/VMA430_GPS_Module), but it keeps failing... I can't really find the error in the logfile, but maybe that's purely because of my inexperience and/or incompetence...

Any help would be greatly appreciated! I added the log file on the action step that keeps failing below, together with the used yml config file:

name: Arduino_CI

on: [pull_request,push]

jobs:
  arduino_ci:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: Arduino-CI/action@stable-1.x   # or latest, or a pinned version
        env:
          # Not all libraries are in the root directory of a repository.
          # Specifying the path of the library here (relative to the root
          # of the repository) will adjust that.
          #
          # The default is the current directory
          #
          USE_SUBDIR: .

          # Not all libraries include examples or unit tests.  The default
          #  behavior of arduino_ci is to assume that "if the files don't
          #  exist, then they were not MEANT to exist".  In other words,
          #  if you were to accidentally delete all your tests or example
          #  sketches, then the CI runner would by default assume that was
          #  intended and return a passing result.
          #
          # If you'd rather have the test runner fail the test in the
          #  absence of either tests or examples, uncommenting either of
          #  the following variables to 'true' (as appropriate) will
          #  enforce that.
          #
          EXPECT_EXAMPLES: true
          EXPECT_UNITTESTS: false

          # Although dependencies will be installed automatically via the
          # library manager, your library under test may require an
          # unofficial version of a dependency.  In those cases, the custom
          # libraries must be insalled prior to the test execution; those
          # installation commands should be placed in a shell script (that
          # will be executed by /bin/sh) stored in your library.
          #
          # Then, set this variable to the path to that file (relative to
          # the root of your repository).  The script will be run from
          # within the Arduino libraries directory; you should NOT attempt
          # to find that directory nor change to it from within the script.
          #
          # CUSTOM_INIT_SCRIPT: install_dependencies.sh
Run Arduino-CI/action@stable-1.x
/usr/bin/docker run --name e4a5b22b1e4ae047a487e4a10e743366e6_2e1886 --label 5588e4 --workdir /github/workspace --rm -e USE_SUBDIR -e EXPECT_EXAMPLES -e EXPECT_UNITTESTS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/VMA430_GPS_Module/VMA430_GPS_Module":"/github/workspace" 5588e4:a5b22b1e4ae047a487e4a10e743366e6
                           .                  __  ___
                   _, ,_  _| , . * ._   _    /  `  | 
                  (_| [ `(_] (_| | [ ) (_)   \__. _|_   v1.3.0

Host OS...                                                                 linux
Located arduino-cli binary...                         /usr/local/bin/arduino-cli
Creating libraries directory...                                                ✓
Environment variable CUSTOM_INIT_SCRIPT...                                    ''
Environment variable USE_SUBDIR...                                           '.'
Installing library under test...                                               ✓
WARNING... Installed library named 'WPI430-VMA430 GPS' has directory name 'workspace'
Library installed at...         /github/home/Arduino/libraries/WPI430-VMA430_GPS

================================================================================
Beginning the next phase of testing...                              Unit testing
The set of compilers (1) isn't empty...                                        ✓
Checking g++ version... 
    Using built-in specs.
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
    OFFLOAD_TARGET_NAMES=nvptx-none
    OFFLOAD_TARGET_DEFAULT=1
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 8.3.0 (Debian 8.3.0-6) 
...Checking g++ version                                                        ✓
libasan availability for g++...                                             true
Library conforms to Arduino library specification...                         1.5
No tests directory at...   /github/home/Arduino/libraries/WPI430-VMA430_GPS/test
Environment variable EXPECT_UNITTESTS is...                       (String) false
Displaying contents of base directory before exit... 
  Files (excluding hidden files): 10
    /github/workspace/README.md
    /github/workspace/examples/Show_time_location/Show_time_location.ino
    /github/workspace/extras/images/add_library.jpg
    /github/workspace/extras/images/download.jpg
    /github/workspace/extras/images/wiring_diagram.png
    /github/workspace/keywords.txt
    /github/workspace/library.properties
    /github/workspace/license.txt
    /github/workspace/src/VMA430_GPS.cpp
    /github/workspace/src/VMA430_GPS.h
...Displaying contents of base directory before exit                           ✗
This may indicate a problem with your configuration; halting here
Failures: 1
========== Last backend command (if relevant):
 $  /usr/local/bin/arduino-cli --format json config dump
========== Backend Stdout:
{
  "board_manager": {
    "additional_urls": []
  },
  "daemon": {
    "port": "50051"
  },
  "directories": {
    "data": "/github/home/.arduino15",
    "downloads": "/github/home/.arduino15/staging",
    "user": "/github/home/Arduino"
  },
  "logging": {
    "file": "",
    "format": "text",
    "level": "info"
  },
  "telemetry": {
    "addr": ":9090",
    "enabled": true
  }
}
========== Backend Stderr:
midasgossye commented 3 years ago

Alright, I should have read the closed issues before I wrote this, sorry... In #17 and #18 it was mentioned that the example configuration incorrectly shows that you can set the EXPECT_UNITTESTS to false. I simply deleted this variable altoghether in my yaml file and everything started working properly!

Below you can find the fixed config file I used in the end:

name: Arduino_CI

on: [pull_request,push]

jobs:
  arduino_ci:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: Arduino-CI/action@stable-1.x   # or latest, or a pinned version
        env:
          # Not all libraries are in the root directory of a repository.
          # Specifying the path of the library here (relative to the root
          # of the repository) will adjust that.
          #
          # The default is the current directory
          #
          USE_SUBDIR: .

          # Not all libraries include examples or unit tests.  The default
          #  behavior of arduino_ci is to assume that "if the files don't
          #  exist, then they were not MEANT to exist".  In other words,
          #  if you were to accidentally delete all your tests or example
          #  sketches, then the CI runner would by default assume that was
          #  intended and return a passing result.
          #
          # If you'd rather have the test runner fail the test in the
          #  absence of either tests or examples, uncommenting either of
          #  the following variables to 'true' (as appropriate) will
          #  enforce that.
          #
          EXPECT_EXAMPLES: true

          # Although dependencies will be installed automatically via the
          # library manager, your library under test may require an
          # unofficial version of a dependency.  In those cases, the custom
          # libraries must be insalled prior to the test execution; those
          # installation commands should be placed in a shell script (that
          # will be executed by /bin/sh) stored in your library.
          #
          # Then, set this variable to the path to that file (relative to
          # the root of your repository).  The script will be run from
          # within the Arduino libraries directory; you should NOT attempt
          # to find that directory nor change to it from within the script.
          #
          # CUSTOM_INIT_SCRIPT: install_dependencies.sh
ianfixes commented 3 years ago

Hi @midasgossye -

I'm sorry for the confusion -- as you can see, I confused myself for a bit there with the way those environment variables are converted to boolean 🤦

But it looks like I haven't properly updated the project README about that mistake, so I will take care of that. Thanks for letting me know!

midasgossye commented 3 years ago

No worries, glad I could sort of help out 😅 I managed to test it out a bit today and I'm really impressed with how well it works (once I managed to set everything up). Thanks for providing this awesome CI tool!

ianfixes commented 3 years ago

That's really nice of you to say! Please don't hesitate to open issues for other stuff that you run across. Documentation is the hardest thing for me to write, since I don't have a way to replicate being a first time user of the project