-
Notifications
You must be signed in to change notification settings - Fork 3
Guide: Replicating the github actions locally for debugging
It is sometimes tricky to debug github actions via the web interface. There is no (easy) way to access the ubuntu docker container while the actions are running.
Some tools have been developed to solve this issue. Example solutions are:
However it is also possible to simpy set up a local ubuntu container with the same configurations as the remote Github container and debug the issue that way. This guide will cover this solution.
Execute these lines one by one.
docker run --rm -it --name github_simulation -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/PycharmProjects/ddueruem-web:/ddueruem-web -d cypress/browsers:chrome69 /bin/bash
docker exec -u root -t -i github_simulation /bin/bash
This should create a container with name github_simulation
and also mount the directory ../ddueruem-web
into the directory ./ddueruem-web
. It will also mount your real docker environment into the container (allows to use docker inside of the container). You will then enter the container as root
user.
Execute these lines one by one.
apt update && apt upgrade
apt install sudo
sudo apt-get update
sudo apt install python3.9
sudo apt install python3-pip
Execute these lines one by one.
cp 'ddueruem-web/backend/ddueruemweb/.env.testing' 'ddueruem-web/backend/ddueruemweb/.env'
cd ddueruem-web/backend
pip3 install -r requirements.txt
python3.9 manage.py makemigrations
python3.9 manage.py migrate --run-syncdb
python3.9 manage.py runserver // do this in extra shell (open new shell with `docker exec -u root -t -i github_simulation /bin/bash`) so you can still type in your original shell
Execute these lines one by one.
sudo apt install npm
cd ../frontend
npm install -g serve
npm run serve // do this in extra shell
Follow this guide: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
Follow this guide: https://shouv.medium.com/how-to-run-cypress-on-wsl2-989b83795fb6
-
Install VcXsrc as described in the guide
-
Configure the
.bashrc
of the linux container:
install nano or any other texteditor
sudo apt install nano
Move into the /home
directory of the linux container
and make sure there is a .bashrc
file
ls -la ~/ | more
Edit the .bashrc
file via nano ~/.bashrc
Also do the other steps of the guide.
To run cypress without GUI execute
npm run env -- cypress run
To run it with GUI execute (NEED TO FOLLOW GUIDE ABOVE!):
npm run cypress:open // -> leads to an error on my machine: https://github.com/intel/libva/issues/278