diff --git a/.github/workflows/ldb-ci.yml b/.github/workflows/ldb-ci.yml new file mode 100644 index 0000000..ef7925f --- /dev/null +++ b/.github/workflows/ldb-ci.yml @@ -0,0 +1,30 @@ +name: Leetcode Daily Bot CI + +on: + pull_request: + push: + branches: + - "main" + + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + # This is the version of the action for setting up Python, not the Python version. + uses: actions/setup-python@v5 + with: + # Semantic version range syntax or exact version of a Python version + python-version: '3.12' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Test + run: | + pip install pytest + pytest tests diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..a635c5c --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath = . diff --git a/requirements.txt b/requirements.txt index d11af65..56fa417 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,5 @@ fastapi jinja2 pymongo python-dotenv +requests +pydantic diff --git a/src/__init__.py b/src/__init__.py index 93f5256..e69de29 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1 +0,0 @@ -__init__.py \ No newline at end of file diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..50bdbe3 --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,5 @@ +from src.common import submission_link + + +def test_submission_link(): + assert submission_link(123) == 'https://leetcode.com/submissions/detail/123'