maturin-action icon indicating copy to clipboard operation
maturin-action copied to clipboard

Support for `working-directory`

Open daemontus opened this issue 3 years ago • 5 comments

Hello, and merry Christmas!

Maybe I am missing something, but is there a way to run this action in some sub-folder of the repository?

I am trying to have a Rust library and its Python bindings in the same repository, but keep the bindings as a separate project (i.e. something like a bindings-py sub-directory that is technically independent of the main Rust library).

However, no matter what I do, the action always seems to run in the repository root.

If this is not possible yet, how hard would it be to implement?

daemontus avatar Dec 21 '21 18:12 daemontus

See https://github.com/messense/maturin-action/issues/11#issuecomment-926621021

messense avatar Dec 22 '21 03:12 messense

BTW, GitHub Actions have native support for working-directory but I haven't tested it with this action yet.

Using the working-directory keyword, you can specify the working directory of where to run the command.

- name: Clean temp directory
  run: rm -rf *
  working-directory: ./temp

messense avatar Dec 22 '21 03:12 messense

BTW, GitHub Actions have native support for working-directory but I haven't tested it with this action yet.

Using the working-directory keyword, you can specify the working directory of where to run the command.

- name: Clean temp directory
  run: rm -rf *
  working-directory: ./temp

This does not work here unfortunately (I've tested it in my repository). However, the workaround through -m you posted seems to resolve my issues (as long as you also properly configure other paths, but this was the one I had most problems with :)). Anyway, thank you very much for the help!

daemontus avatar Dec 22 '21 09:12 daemontus

Blocked on upstream issue: https://github.com/actions/runner/issues/467#issuecomment-624777265

messense avatar Feb 25 '22 07:02 messense

If you have to update [tool.maturin] in pyproject.toml as well to account for the full path if you are working in rust/python mixed project. https://github.com/PyO3/maturin#mixed-rustpython-projects

[tool.maturin]
python-source = "folder/to/python/"

kddejong avatar Sep 01 '22 17:09 kddejong