nickcharlton / diff-check

An Action which runs a given command and fails if it changes anything
MIT License
1 stars 1 forks source link

bin/diff-check: No such file or directory #4

Closed oscargus closed 5 months ago

oscargus commented 6 months ago

Found this seemingly very useful action, but when trying to run it I got:

Run bin/diff-check >> $GITHUB_STEP_SUMMARY
  bin/diff-check >> $GITHUB_STEP_SUMMARY
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.14/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.14/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.14/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.14/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.14/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.14/x64/lib
/home/runner/work/_temp/[47](https://github.com/apytypes/apytypes/actions/runs/9329981048/job/25683042789?pr=457#step:6:50)6019dd-209a-4187-97ef-7edb2a35c12c.sh: line 1: bin/diff-check: No such file or directory
Error: Process completed with exit code 127.

so my interpretation is that bin/diff-check cannot be accessed from my workflow?

nickcharlton commented 6 months ago

Are you able to share the workflow at all?

It's a bit of a nightmare to debug (both the problem itself and often the workflow setup.)

oscargus commented 5 months ago

Sure! I created a PR https://github.com/apytypes/apytypes/pull/466

It is the "Stub and doc tests" https://github.com/apytypes/apytypes/actions/runs/9398262105/job/25883241120?pr=465

The purpose of the test is to automatically regenerate stub-files and then use diff-check to see that the committed ones are up-to-date.

nickcharlton commented 5 months ago

Thanks!

Could you try using the branch fix-path?

You can just do something like: - uses: nickcharlton/diff-check@fix-path in your workflow.

I think I misread how PATH is handled back when I first published it and there's a commit which simplifies how I was doing that and should fix it.

oscargus commented 5 months ago

The new branch seems to work! Thanks!

Failing (diff): https://github.com/apytypes/apytypes/actions/runs/9466284454/job/26077616377 Passing (no diff): https://github.com/apytypes/apytypes/actions/runs/9466372377/job/26077906228?pr=466

Maybe one would like to use tee instead of >> so that one can see the changed file message in the workflow? (Minor thing, but as the change is in a Python file __init__.py, the file name is rendered as init, is it possible to render the file names in backticks(?).)

nickcharlton commented 5 months ago

Excellent, thanks for testing and providing those examples!

I've gone ahead and opened PRs for both of those ideas — looking at my shell history it seems like I tried to do something with tee, but never managed it. I found an answer this time though, which is cool.

I haven't really tested those PRs I opened, but figured I'd just do it and test it tomorrow!