-
Notifications
You must be signed in to change notification settings - Fork 0
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
[terraform] add cache layer to CI for modules and providers #67
base: main
Are you sure you want to change the base?
[terraform] add cache layer to CI for modules and providers #67
Conversation
4a2074c
to
20099b8
Compare
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.
Exciting! Just some thoughts about not using $HOME
- name: Configure Terraform plugin cache | ||
shell: bash | ||
run: | | ||
echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" |
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.
Should this be in the home our would it be better to use a tmp folder that is different for each agent?
In case agents are not ephemeral to avoid any pollution
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.
You could replace $HOME
refs with ${{ runner.temp }}
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.
that folder is emptied after each job.. wouldn't that defeat the purpose of the cache?
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 it should be fine. You load from S3 into that folder before tf runs and you isolate runs between jobs of different repos as you are not using the runner home folders, which for not epehemeral runners is not cleaned up.
with: | ||
bucket: ${{ inputs.s3-bucket-name }} | ||
use-fallback: false | ||
path: ~/.terraform.d/plugin-cache |
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.
Use ${{ runner.temp }}
here as well
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.
This is what we set it to in the pre-commit cache: ${{ runner.temp }}/${{ github.event.repository.name }}/cache-pre-commit-${{ steps.pre_commit_cache_key.outputs.key }}
https://github.com/open-turo/action-pre-commit/blob/main/action.yaml
20099b8
to
dabb2e9
Compare
dabb2e9
to
0538023
Compare
Release notes previewBelow is a preview of the release notes if your PR gets merged. 3.9.0 (2024-11-18)Features
Miscellaneous
|
Description
Changes
🚀 PR created with fotingo