-
I’m trying to use container in order to run my tests with the GH actions. In my case it’s wordpress image. And from what I understood, when I use something like
Inside my job, it creates a docker container and mounts my repository. So every action I do, it’s executed inside that container. When I look at my workflow I can see this
So it’s like I did
on my local machine. Now, locally, I can exec to that container and I can see the WordPress files installed in the What I’m interested in is: how to do something like that in the action? I want to run tests, but for that, I need to provide the path to the WP installation. Either that, or I’d need a way to mount my plugin inside the container, and I’m not sure if just adding volumes to my container part in the YAML file
will work? And then, how to run tests inside the container?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@dingo-d , If you have installed the required tool on the host machine and also know the installation directory of the tool, you can try using the syntax “jobs.<job_id>.container.volumes” to set a volume for the tool’s installation directory.
The <source> is the absolute path of the tool’s installation directory on the host machine, and <destinationPath> is an absolute path you set in the container. Of course, if the required tool has not been installed on the host machine, you also can add a step in the container job to install the required tool in the container. About running tests, you just need to execute steps (commands, actions) for the tests in the same container job. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation :) |
Beta Was this translation helpful? Give feedback.
@dingo-d ,
If you have installed the required tool on the host machine and also know the installation directory of the tool, you can try using the syntax “jobs.<job_id>.container.volumes” to set a volume for the tool’s installation directory.
The <source> is the absolute path of the tool’s installation directory on the host machine, and <destinationPath> is an absolute path you set in the container.
Of course, if the required tool has not been installed on the host machine, you also can add a step in the container job to install the required tool in the container.
About running tests, you just need to execute steps (commands, actions) for the tests…