1

I have a build failing because it doesn't find some particular file in some particular path. Possibly this file is just in a different SDK directory (because of having a new version), so I just want to search for it in the whole C: drive.

However, if I issue the following step in my GithubActions workflow:

- name: dir
  run: |
    c: && cd \ && dir /s TheFileNameThatILookFor.SomeExtension

Then the workflow hangs! It keeps executing forever and never finishes. (Proof.)

How to find specific files then?

UPDATE: after 5hours the CI process was aborted (probably by some timeout set by GithubActions infrastructure), and then I could see the output of dir /s, if you can wait, just do that. If not, you could try what @Samira suggests in her/his answer, but IME it doesn't always work (e.g. if I try to search for a file with a long file name, it doesn't find it: the log that proves this, but in other cases it has worked) and it's still kinda long, 40min! but not as long as 5hours...

knocte
  • 16,941
  • 11
  • 79
  • 125

1 Answers1

2

You could take advantage of the fact that bash, which is available for all platforms, comes together with set of handy tools in PATH.

Instead of dir, try to experiment with find - it still going to take some time (example below took ~40 minutes), but you'll be using a tool designed for the task.

Example:

- run: find /c/ -name "*.targets"
Samira
  • 7,795
  • 3
  • 25
  • 25
  • and what's `C:` in bash? `/c/`? – knocte Sep 27 '19 at 11:23
  • @knocte yes, it should be something like `find /c/ -name "filename.ext"` – Samira Sep 27 '19 at 11:28
  • launched new build https://github.com/nblockchain/ZXing.Net.Xamarin/runs/238732788, let's see if it hangs or not... – knocte Sep 27 '19 at 12:25
  • 1
    see my updated question, I upvote you but don't give the green tick :-/ – knocte Oct 06 '19 at 16:49
  • @knocte You can't find the file because it simply isn't there, i think :) I've searched /c/ for .targets, see [here](https://github.com/wipe2238/github-actions-test/commit/905885d379d2e1ad676b4c60b839b9165a1e7a9a/checks/238648967/logs), and it couldn't find file with exact same name you looking for... There is few similiar, sure, but not yours. – Samira Oct 06 '19 at 17:40
  • 1
    OK looks you're right; now i'm curious why find fails, but not curious enough to run 40m long tests... – Samira Oct 06 '19 at 18:13