You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
So I have a repo with a python script that is a CI/CD tool used in other GitHub Actions across my organization. I had the idea of creating a composite action for this tool's repo that just sets up the python environment and gets it added to the PATH so it can be called by subsequent actions. I've already sorted out the 'Admin privileges required' nonsense (which I think you should also fix, btw). I know I can get all of this to work if I move the code from the action.yml file to a workflow_dispatch Action in my tool's repository. But it fails when I try to use the same steps in a composite action.
Also, I know people are going to warn me about affecting the outside python environment, etc. I don't really care about that. I just want this functionality to work.
I also get it that I can just not cache the virtualenv. Yes, this is true, but that adds a fair amount of time to the process. I would like to use the caching feature if possible.
Action version:
actions/setup-python@v3
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
Python 3.10.4
Repro steps:
Have a repo (I'm calling it 'my-org/my-tool.git' in this setup) containing a python package with a setup.py file that has an entry_point defined (for purposes of this setup, we'll call the entry point 'my-tool'). Also, I'm using pipenv. and there's a Pipfile.lock in the my-org/my-tool.git repo.
Create an action.yml in my-org/my-tool.git:
name: Setup My Tooldescription: "Setup My Tool so 'my-tool.exe' is in the PATH and subsequent actions can call it."runs:
using: compositesteps:
- name: Install pipenvrun: pip install pipenvshell: cmd
- name: Setup Pythonuses: action/setup-python@v3with:
cache: pipenvpython-version: 3.10.4cache-dependency-path: "${{ github.action_path }}/Pipfile.lock"
- name: Install My Tool and Dependenciesrun: pipenv sync --python 3.10.4working-directory: "${{ github.action_path }}"shell: cmd
Then, create an Actions workflow file .github/workflows/random_workflow.yml in another repo (let's say 'my-org/my-project.git'):
name: Some random workflowon: [workflow_dispatch]jobs:
runTool:
runs-on: [self-hosted, Windows, yadda, yadda, yadda]steps:
- name: Setup My Tooluses: my-org/my-tool@master
- name: Use My Toolrun: my-tool.exe some-args --and --stuffshell: cmd
Actual behavior:
When the composite action reaches the setup-python step, it throws this error: Error: No file in D:\B\my-project\my-project matched to [D:\B\_actions\my-org\my-tool\master/Pipfile.lock], make sure you have checked out the target repository
To my eye, it looks like the setup-python action is trying to prevent specifying paths for cache-dependency-path outside of the GitHub Actions working directory. This restriction should be relaxed to allow specifying paths inside the _actions folder as well.
The text was updated successfully, but these errors were encountered:
Description:
So I have a repo with a python script that is a CI/CD tool used in other GitHub Actions across my organization. I had the idea of creating a composite action for this tool's repo that just sets up the python environment and gets it added to the PATH so it can be called by subsequent actions. I've already sorted out the 'Admin privileges required' nonsense (which I think you should also fix, btw). I know I can get all of this to work if I move the code from the action.yml file to a workflow_dispatch Action in my tool's repository. But it fails when I try to use the same steps in a composite action.
Also, I know people are going to warn me about affecting the outside python environment, etc. I don't really care about that. I just want this functionality to work.
I also get it that I can just not cache the virtualenv. Yes, this is true, but that adds a fair amount of time to the process. I would like to use the caching feature if possible.
Action version:
actions/setup-python@v3
Platform:
Runner type:
Tools version:
Python 3.10.4
Repro steps:
Have a repo (I'm calling it 'my-org/my-tool.git' in this setup) containing a python package with a setup.py file that has an entry_point defined (for purposes of this setup, we'll call the entry point 'my-tool'). Also, I'm using pipenv. and there's a Pipfile.lock in the my-org/my-tool.git repo.
Create an
action.yml
in my-org/my-tool.git:Then, create an Actions workflow file
.github/workflows/random_workflow.yml
in another repo (let's say 'my-org/my-project.git'):Expected behavior:
It Just Works.©
Actual behavior:
When the composite action reaches the setup-python step, it throws this error:
Error: No file in D:\B\my-project\my-project matched to [D:\B\_actions\my-org\my-tool\master/Pipfile.lock], make sure you have checked out the target repository
To my eye, it looks like the setup-python action is trying to prevent specifying paths for cache-dependency-path outside of the GitHub Actions working directory. This restriction should be relaxed to allow specifying paths inside the _actions folder as well.
The text was updated successfully, but these errors were encountered: