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

CI: Run setup-rust-toolchain from fork with cache key support #77

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

iainlane
Copy link
Owner

We run the build for amd64 and arm64, and we use setup-rust-toolchain to install and cache the Rust toolchain and project dependencies.

The caching part of that action doesn't currently work if it's run in multiple jobs from the same workflow run. The cache key doesn't contain anything that would disambiguate and there is no input to setup-rust-toolchain to allow it to be customised.

To fix that, I've just submitted a PR to the action to allow the cache key to be customised. This will allow us to set a key that includes the OS and architecture of the build, so that the caches are kept separate. We're making use of that here.

We run the build for amd64 and arm64, and we use `setup-rust-toolchain` to
install and cache the Rust toolchain and project dependencies.

The caching part of that action doesn't currently work if it's run in multiple
jobs from the same workflow run. The cache key doesn't contain anything that
would disambiguate and there is no input to `setup-rust-toolchain` to allow it
to be customised.

To fix that, I've just [submitted a PR][PR] to the action to allow the cache key
to be customised. This will allow us to set a key that includes the OS and
architecture of the build, so that the caches are kept separate. We're making
use of that here.

[PR]: actions-rust-lang/setup-rust-toolchain#41
@iainlane iainlane force-pushed the iainlane/rust-toolchain-cache-key branch from 84313b1 to eefcd5e Compare July 12, 2024 07:37
Copy link

🍹 preview on lambda-rssfilter/organization/lambda-rssfilter/prod

Pulumi report
Previewing update (prod):
@ previewing update..........

@ previewing update....
pulumi:pulumi:Stack lambda-rssfilter-prod running 
@ previewing update..........
pulumi:pulumi:Stack lambda-rssfilter-prod running info: [runtime] project has changes, rebuilding
++ pulumi-nodejs:dynamic:Resource build-rust-lambda:lambda-rssfilter create replacement 
+- pulumi-nodejs:dynamic:Resource build-rust-lambda:lambda-rssfilter replace 
@ previewing update....
aws-native:s3:Bucket lambda-rssfilter  
pulumi:pulumi:Stack lambda-rssfilter-prod running read pulumi:pulumi:StackReference organization/lambda-rssfilter-core/shared
@ previewing update....
aws:s3:BucketObject index.html  
~  aws:s3:BucketObjectv2 lambda-rssfilter-zip update [diff: ~contentBase64]
aws-native:iam:Role lambda-rssfilter  
aws:acm:Certificate lambda-rssfilter-cert  
pulumi:pulumi:Stack lambda-rssfilter-prod running read aws-native:kms:Alias stateBucketKey
aws-native:logs:LogGroup lambda-rssfilter  
pulumi:providers:gandi gandi  
aws:apigatewayv2:Api lambda-rssfilter  
aws-native:iam:RolePolicy lambda-rssfilter-cloudwatch  
~  aws-native:lambda:Function lambda-rssfilter update [diff: ~code]
aws-native:iam:RolePolicy lambda-rssfilter-xray-write  
gandi:livedns:Record lambda-rssfilter-cert-validation  
aws:apigatewayv2:Stage lambda-rssfilter-stage  
~  aws:apigatewayv2:Integration lambda-rssfilter-integration update [diff: ~integrationUri]
pulumi:pulumi:Stack lambda-rssfilter-prod running read pulumi:pulumi:StackReference organization/lambda-rssfilter-core/shared
aws:acm:CertificateValidation lambda-rssfilter-cert-validation  
-- aws-native:lambda:Permission lambda-rssfilter-invoke-permission delete original 
+- aws-native:lambda:Permission lambda-rssfilter-invoke-permission replace [diff: ~functionName]
++ aws-native:lambda:Permission lambda-rssfilter-invoke-permission create replacement [diff: ~functionName]
aws:apigatewayv2:Route lambda-rssfilter-route  
aws:apigatewayv2:DomainName lambda-rssfilter-domain  
gandi:livedns:Record lambda-rssfilter-cname  
aws:apigatewayv2:ApiMapping lambda-rssfilter-mapping  
pulumi:pulumi:Stack lambda-rssfilter-prod running read aws-native:kms:Alias stateBucketKey
pulumi:pulumi:Stack lambda-rssfilter-prod running read aws-native:kms:Key stateBucketKey
@ previewing update....
aws-native:iam:Role oidcPushRole  
aws-native:iam:Role oidcPullRequestRole  
~  aws-native:iam:ManagedPolicy createPolicy update [diff: ~policyDocument]
aws-native:kms:Key stateBucketKey  warning: Can't import write-only properties: bypassPolicyLockoutSafetyCheck, pendingWindowInDays, rotationPeriodInDays
pulumi:pulumi:Stack lambda-rssfilter-prod running read aws-native:kms:Key stateBucketKey
~  aws-native:iam:ManagedPolicy stateBucketPolicy update [diff: ~policyDocument]
-- pulumi-nodejs:dynamic:Resource build-rust-lambda:lambda-rssfilter delete original 
aws-native:kms:Key stateBucketKey  1 warning
pulumi:pulumi:Stack lambda-rssfilter-prod  1 message
Diagnostics:
aws-native:kms:Key (stateBucketKey):
warning: Can't import write-only properties: bypassPolicyLockoutSafetyCheck, pendingWindowInDays, rotationPeriodInDays

pulumi:pulumi:Stack (lambda-rssfilter-prod):
info: [runtime] project has changes, rebuilding

Resources:
~ 5 to update
+-2 to replace
7 changes. 19 unchanged

@iainlane iainlane merged commit eefcd5e into main Jul 12, 2024
5 checks passed
@iainlane iainlane deleted the iainlane/rust-toolchain-cache-key branch July 12, 2024 07:46
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant