HACKER Q&A
📣 treeboy0384

How do you handle CI pipeline in front end-back end monorepo


How do you handle CI pipeline in monorepo that contains frontend & backend service? I usually use Github Actions for CI/CD pipeline. I'm looking for how to build backend and frontend in same container and test frontend code with API calls. I thought it was possible but I can't find anywhere to use them. There are some posts using multiple github actions file for microservice in monorepo. FYI) I use React/Django


  👤 ianpurton Accepted Answer ✓
Can you build 2 containers and run them up in the pipeline.

docker run --rm -d my/webfronent docker run --rm -d my/backend

Then run your tests.

Also worth noting is that the ubuntu image on github is fully loaded with tools including chromedriver to drive headless chrome.

Here's an example from one of my pipelines.

https://github.com/authn-proxy/authn-proxy/blob/master/.gith...


👤 evrflx
Using testcontainers is a good approach: it exists for backend (like Java, python) as for frontend (JavaScript / typescript) stacks. It can build an image and launch it on the fly together with service containers which is really nice for integration tests. I did not test it on gh actions though.