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

actions: Use pip cache #269

Open
jku opened this issue Apr 16, 2024 · 2 comments
Open

actions: Use pip cache #269

jku opened this issue Apr 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jku
Copy link
Member

jku commented Apr 16, 2024

All actions (actions/*/action.yml) that use setup-python should use cache and cache-dependency-path keys.

The correct paths are likely repo/pyproject.toml and repo/install/requirements.txt

@jku jku added the enhancement New feature or request label Apr 16, 2024
@jku
Copy link
Member Author

jku commented Apr 17, 2024

@jku
Copy link
Member Author

jku commented Jan 22, 2025

Currently all our actions have a copy of this:

    - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
      with:
        python-version: "3.11"

    - run: |
        echo "::group::Install tuf-on-ci"
        ROOT=$GITHUB_ACTION_PATH/../..
        pip install -c $ROOT/action-constraints.txt $ROOT/repo/
        echo "::endgroup::"
      shell: bash

we could replace them all with:

    - uses: ./actions/setup-tuf-on-ci

The new internal action setup-tuf-on-ci would then:

  • copy $ROOT/action-constraints.txt into a location within the workspace
  • setup python with caching using the copy of action-constraints.txt
  • install tuf-on-ci (now using cache)

The advantages would be:

  • caching is possible
  • changes (like python version upgrade) happen in a single place

The only possible issue I see is the cache being somehow poisoned (accidentally or no). Without hashes in action-constraints.txt I'm not sure I'd like to enable the caching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant