Help with actions for Ruby gem #25851
-
I have a Ruby gem which I’ve been building with Travis but I want to make the transition to GitHub actions. I took the example Ruby gem action and expanded upon it somewhat, but I feel it could be further improved. The file as it stands now: As you can see I have three jobs:
What I would like to improve:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
No caching available yet… EDIT: Posted too fast… next step or next job? Everything is in place until job finishes, so everything* you do in one step is visible in another. If it’s about next job, currently only way to pass files from job to job is to upload files in one job and download in another (for example using actions/upload-artifact + actions/download-artifact). *Current directory changes on each step; if you
You have a small mistake there;
should be
If you want to skip whole job, move that check under
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the hints. I moved the if statement and indeed it’s skipping that job altogether. As for artifact uploading and downloading: I printed out where it is installing the gems and it said: /opt/hostedtoolcache/Ruby/2.6.3/x64/lib/ruby/gems/2.6.0/gems - so I thought I’ll upload that directory as an artifact and download it in the next job. The problem is that that directory is huge, because as its name says it’s basically a systemwide cache. And since the upload was progressing really slowly I canceled it, but I’m not sure it would have worked anyway because AFAIK bundle install does some linking too. The good news is that as stated here they’re currently working on caching, so I won’t try reinvent the wheel, I’ll just wait patiently. |
Beta Was this translation helpful? Give feedback.
No caching available yet…
EDIT: Posted too fast… next step or next job?
Everything is in place until job finishes, so everything* you do in one step is visible in another.
If it’s about next job, currently only way to pass files from job to job is to upload files in one job and download in another (for example using actions/upload-artifact + actions/download-artifact).
*Current directory changes on each step; if you
cd my_dir
in one step, next one will push you back where you started.