-
Notifications
You must be signed in to change notification settings - Fork 2
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
monorepo prep: use contextual cache names, add working_directory input #41
Conversation
LGTM. You can release it and opt in your branch to bump the version in api/worker. If that CI works then you know your change is legit.
Maybe but we also use these same workflows in a couple other repos including internal ones. Not saying we are shackled to these but its nice to have it all in one place. |
e342767
to
fd45841
Compare
requirements.tar | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/docker/Dockerfile.requirements') }} | ||
${{ inputs.working_directory }}/requirements.tar | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles(format('{0}/**/requirements.txt', inputs.working_directory)) }}-${{ hashFiles(format('{0}/**/docker/Dockerfile.requirements', inputs.working_directory)) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will hash a requirements.txt
. For migrating to uv
, I will need it to hash a uv.lock
file instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted. i will skip that for the moment because i don't want it to blow up if the lockfile doesn't exist yet
currently we use cache names like
cache-requirements
. when worker and api are in different repositories, that's fine - their caches will remain separate. but when we move them all into a monorepo, they will collide. this PR includes the image repo argument in the cache nameour workflows all also assume they are operating out of the repository root. https://github.com/codecov/umbrella, however, will probably organize them in a structure like this:
so this PR adds a
working_directory
input and uses it as the default working directory for allrun:
-type steps. we can run worker tests in umbrella by calling therun-tests.yml
workflow withworking_directory: apps/worker
. some things to note:.
so no change should be necessary to the current separate repos. this is just helpful for umbrellauses:
-type steps (like cache actions) will not use the default working directory. for these steps, paths need to be prefixed with${{ inputs.working_directory }}/
down the line we should absorb these workflows into the monorepo but fine for now