The problem is that Arduino IDE 1.8.0 and 1.8.1 fail to verify a sketch if the absolute path to it is not specified, even though you are running the command from the sketch folder. You should be able to solve the problem by upgrading to Arduino IDE 1.8.3. If for some reason you need to continue to use 1.8.0 then you will need to specify the path to the sketch.
pert:
The problem is that Arduino IDE 1.8.0 and 1.8.1 fail to verify a sketch if the absolute path to it is not specified, even though you are running the command from the sketch folder. You should be able to solve the problem by upgrading to Arduino IDE 1.8.3. If for some reason you need to continue to use 1.8.0 then you will need to specify the path to the sketch.
I guess that was a bug in those IDE versions. I ran into this a couple months ago in my Travis CI tests and definitely wasted some hours trying to figure out why my builds were failing for no reason. Luckily after looking back over this thread I remembered there was something like that with certain IDE versions and found a comment about it in my script.