Roughtly the same as you would do locally but using a single console prompt.
E.g. run server processes in background like https://travis-ci.community/t/running-docker-containers-in-parallel-with-tests/7046:
install:
- /path/to/server1 args & PIDS="$!" # a service may provide some other way to know its PID like a pidfile
- /path/to/server2 args & PIDS="$PIDS $!"
script:
- <run tests>
after_script:
- kill $PIDS # or shut down servers gracefully in some other service-specific way
- wait $PIDS # likewise, a service may provide some other way to wait for its shutdown