Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running on self-hosted runners leaves files in GITHUB_WORKSPACE #101

Closed
2 of 7 tasks
russellcardullo opened this issue Jun 8, 2020 · 9 comments
Closed
2 of 7 tasks
Assignees
Labels
bug Something isn't working

Comments

@russellcardullo
Copy link

Describe the bug
The very first time setup-python is called for a specific version on a self hosted runner, the action will download files into the GITHUB_WORKSPACE and leave them there.

This causes issues for later steps, for instance if I have a step to run linters it runs on the temporary files setup-python downloads.

Which version of the action are you using?

  • v1
  • v2
  • Some other tag (such as v2.0.1 or master)

Environment

  • self-hosted
  • Linux
  • Windows
  • Mac

If applicable, please specify if you're using a container

Python Versions
Please list all of the effected versions of Python (3.8.2, etc.)

To Reproduce

This workflow file run on a self-hosted Ubuntu 18.04 linux server will reproduce:

name: Test setup-python workspace
on: push
jobs:
  test:
    name: Test setup-python
    runs-on: [self-hosted, linux]
    steps:
      - uses: actions/checkout@v2
      - name: before
        run: |
          ls
          ls $GITHUB_WORKSPACE
          du -hc ./
      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 2.7.17
      - name: after
        run: |
          ls
          ls $GITHUB_WORKSPACE
          du -hc ./

After running this you should see a directory with a UUID that adds approximately ~130MB of files to the workspace.

Run/Repo Url
If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@russellcardullo russellcardullo added the bug Something isn't working label Jun 8, 2020
@annarailton
Copy link

+1

I've had exactly the same issue and it's caused havoc in pytest test discovery.

@aibaars
Copy link

aibaars commented Jul 10, 2020

I think Actions should avoid writing into GITHUB_WORKSPACE as best practice, because this could cause build failures. The workspace is where the source code is checked out. The other setup-X actions seem to download and extract files into the toolcache. This has as added benefit that downloads are cached between runs on self-hosted runners.

@jeking3
Copy link

jeking3 commented Jul 15, 2020

I ran into this issue and my build started to run the python distro unit tests!

@jeking3
Copy link

jeking3 commented Jul 15, 2020

Per #106 reordering the checkout and setup-python resolves this.

@maxim-lobanov
Copy link
Contributor

We are working to provide fix for this issue

@MaksimZhukov
Copy link
Contributor

Hello @russellcardullo !
We have released actions/setup-python v2.1.1 with fix for this issue. Could you please change version of setup-python action in your workflow and check that issue is resolved?

@russellcardullo
Copy link
Author

Thanks @MaksimZhukov! I'll give it a try today and let you know if I run into this again.

@adamchainz
Copy link

@MaksimZhukov That has fixed the issue for me (#117). Thank you!

@nikita-bykov
Copy link
Contributor

It looks like the problem has been resolved and we are going to close this issue. But if you still have any problems, please notify us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants