Is it possible to checkout code before starting a service?

I’m using the service containers to spin up a couple of services my tests need. It’s working great!

However, I’m running into an issue. One of the services I’m using expects to have a configuration file (exposed by a volume) before it starts. This configuration file lives in my repo, but it looks the service start before the checkout action runs.

Is it possible to have checkout happen before the services start? Any tips for making a user supplied config is available to a service container.

Thank you!

You’ll probably have to start your container(s) manually to achieve that, e.g. with docker run commands in the workflow after checkout. Just make sure to attach them to the Docker network with the name set in job.container.network (see job context) and they should be reachable the same as the services configured for the job.

1 Like