Fix AppVeyor CI script to scan for files and fail build on syntax error
kenorb opened this issue · 7 comments
File to fix: appveyor.yml
There are two goals:
- For each
.mqh
file (including submodules) run the compiler/syntax checker (e.g. usingmetaeditor
). - When compiler fails to compile one of the files, the whole build script should fail. You can use
forfiles
usually returns all the time the successful build.
Current CI test results can be found in here.
You can test that as part of the PR, or you can also clone the repo, activate CI tests on your fork and test it.
I have created a pull request with what seems to be an appropriate fix for this issue. It appears to pass the tests from AppVeyor, though it fails the Travis tests. Does this resolve your issue?
I think the issue is how metaeditor
is badly designed. Its exit code is basically the number of files being successfully compiled.
So if metaeditor
compiled one file, it'll return exit code 1, which is the error (which is actually not). I think we just need to ignore the exit code from the metaeditor
, so it can progress further, so we can test findstr
logic.
I've fixed it, now it fails on your part.
See: https://ci.appveyor.com/project/kenorb/ea31337-strategies/build/1.0.22
Result 0 error(s), 0 warning(s)
No compilation errors, but it fails. It should only fail on the compilation warnings or errors.
Alright. I'll try something else for that line.
For easier testing, I've created two branches: ci-fail
and ci-success
.
Currently ci-fail
has success on errors as per: https://ci.appveyor.com/project/kenorb/ea31337-strategies/build/1.0.25 (this is incorrect).
And ci-success
got success on successful compilation as expected: https://ci.appveyor.com/project/kenorb/ea31337-strategies/build/1.0.26 (this is correct).
I think it works now.