Pass the repository to next step in workflow runs

I want to include 3 jobs test, build and deploy. Each step requires the previous one to be successfully completed.

In the test job, I am using checkout action to clone the repo, install nodejs dependencies (takes around 100 secs). Currently, when the test is passed, these time-consuming steps are again executed in the following jobs.

So can I just clone it for once, and pass on the cloned repo (action/checkout@v2) to following jobs?

Each job gets a fresh environment, so directly passing on the directory is not possible. There are two things you could look at, I’m not sure if they’re suitable for your case:

@airtower-luna is spot on. the other option is not using three jobs, and doing it all in one job.

1 Like

@mickeygousset I don’t it’s a good idea or not, but I can fix this with upload/download artifacts.

Again, artifacts should be uploaded in the build stage and we have still no solution for testbuild

I wouldn’t use upload/download artifacts. I mean, you could, but its not probably the best way, or what they are designed for. I would look at the Caching suggested by @airtower-luna first.