This repository contains the code problems and the github actions workflow for CodeScript.
- Git
- GitHub Runner
- Python 3.13.5
- MySQL
- Docker
- Clone the repository
git clone git@github.com:jjpark987/codescript-db.git
- Create a virtual environment if there isn't one already
python -m venv .venv
- Activate virtual environment
source .venv/bin/activate
- Install dependencies
pip install -r requirements.txt
-
Make sure codescript-fastapi is running
-
To parse and post /python/main.py
python -m python.scripts.db.post_problems
- To parse and post a problem
python -m python.scripts.db.post_problems --file "python/problems/combinatorics/counting/new_problem.py"
- To parse and post all problems in problems/
python -m python.scripts.db.post_problems --all
- To upload an image
python -m python.scripts.db.upload_images --file "python/images/new_image.png"
- To upload all images
python -m python.scripts.db.upload_images --all
- To rename a problem
python -m python.scripts.repo.rename_problems --file "python/main.py"
- To rename all problems
python -m python.scripts.repo.rename_problems --all
- To rename an image
python -m python.scripts.repo.rename_images --file "python/main.py"
- To rename all images
python -m python.scripts.repo.rename_images --all
- To copy and paste main.py into the subcategory directory and rename it to the problem title
python -m python.scripts.repo.copy_main
- Build image, create container, and activate in the foreground
docker compose up --build --abort-on-container-exit
-
Verify Docker Desktop is running in the background
-
Verify GitHub Runner from ~/actions-runner is running in the background
- Verify runner from ~/actions-runner
cd ~/Projects/codescript/actions-runner && ./svc.sh status
- Start runner from ~/actions-runner
cd ~/Projects/codescript/actions-runner && ./svc.sh start
- Add new files to python/problems/ and images/ to trigger GitHub Action workflow