Skip to content

Commit b342759

Browse files
committed
CI and basic test
1 parent c5d3753 commit b342759

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

.github/workflows/ldb-ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Leetcode Daily Bot CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "main"
8+
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
# This is the version of the action for setting up Python, not the Python version.
19+
uses: actions/setup-python@v5
20+
with:
21+
# Semantic version range syntax or exact version of a Python version
22+
python-version: '3.12'
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
- name: Test
28+
run: |
29+
pip install pytest
30+
pytest tests

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ fastapi
33
jinja2
44
pymongo
55
python-dotenv
6+
requests
7+
pydantic

src/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
__init__.py

tests/test_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from src.common import submission_link
2+
3+
4+
def test_submission_link():
5+
assert submission_link(123) == 'https://leetcode.com/submissions/detail/123'

0 commit comments

Comments
 (0)