Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Guide: Replicating the github actions locally for debugging

Bishares edited this page Nov 11, 2022 · 13 revisions

The issue with debugging github actions

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.

Setting up a local ubuntu container

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 ubuntu:latest /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.

installing all the stuff in the container

Execute these lines one by one.

cd ddueruem-web/frontend
apt update && apt upgrade
apt install sudo
sudo apt-get update
sudo apt-get install python3.10
sudo apt install python3-pip

Setting up the server

Execute these lines one by one.

File copying and requirements installation

mv '../backend/ddueruemweb/.env.testing' '../backend/ddueruemweb/.env'
cd ../backend
pip install -r requirements.txt

Running Django migrations

python3.10 manage.py makemigrations
python3.10 manage.py migrate --run-syncdb
python3.10 manage.py runserver TODO: do this in extra thread so i can still type in container

Setting up the frontend

TODO

Clone this wiki locally