We are searching for the right way to formulate some Windows commands in travis.yml.
The failing Travis job can be found here:
https://travis-ci.com/ICB-DCM/AMICI/jobs/261111212
The relevant parts of the job are here:
334 0.55s $ if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell -Command Get-ChildItem ./scripts; fi install.22
374 0.05s $ if [[ "$TRAVIS:OS:NAME" == "windows" ]]; then powershell -Command $VerbosePreference='Continue'; fi install.23
375 0.05s $ if [[ "$TRAVIS:OS:NAME" == "windows" ]]; then powershell -File C:/Users/travis/build/AMICI/scripts/installOpenBLAS.ps1; fi install.24
376 0.05s $ if [[ "$TRAVIS:OS:NAME" == "windows" ]]; then powershell -Command $VerbosePreference='SilentlyContinue'; fi
377 0.05s $ if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell -Command if (Test-Path 'C:\BLAS') {Get-ChildItem 'C:\BLAS' -Recurse}; fi
378 The command "if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell -Command if (Test-Path 'C:\BLAS') {Get-ChildItem 'C:\BLAS' -Recurse}; fi" failed and exited with 1 during .
379
380 Your build has been stopped.
381 From https://github.com/ICB-DCM/AMICI
382 * [new ref] refs/pull/847/head -> develop
383 Switched to branch 'develop'
384 /c/Users/travis/.travis/functions: eval: line 109: syntax error near unexpected token `('
385 /c/Users/travis/.travis/functions: eval: line 109: `if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell -Command if (Test-Path 'C:\BLAS') {Get-ChildItem 'C:\BLAS' -Recurse}; fi '
In line 374, I am enabling PowerShell verbose mode, and the installOpenBLAS.ps1 script starts with
Write-Host 'script installOpenBLAS.ps1 started'
However, I don’t see any output at all, so it looks like the script was not started.
In line 384, you can see that “eval” has a syntax error at the opening parenthesis.
All of this is telling me that I don’t know enough about how to formulate commands in travis.yml
. What is wrong with line 375? Do I need to write \(
in line 385? Is there any more documentation on this?
I have also added a comment to this post:
https://travis-ci.community/t/powershell-scripts-fail-to-run-with-no-error-message/2288