Skip to content

Commit

Permalink
👷 CI support tests
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jul 15, 2024
1 parent 1b9e9f0 commit 392fcfc
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 55 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ jobs:

- name: Install Dependencies
run: |
python -m pip install httpx black
python -m pip install virtualenv pdm
python -m virtualenv venv
pdm use venv
source venv/bin/activate
pdm install -G :all
- name: Fetch Remote Files
run: |
source venv/bin/activate
cd compiler
python main.py
cd hsr-optimizer-api
Expand All @@ -34,6 +39,11 @@ jobs:
cd ../..
black .
- name: Test New files
run: |
source venv/bin/activate
pytest
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion compiler/get_metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from httpx import get

url = "https://raw.githubusercontent.com/fribbels/hsr-optimizer/main/src/lib/"
url = "https://raw.githubusercontent.com/PaiGramTeam/hsr-optimizer/main/src/lib/"
HEAD_DATA = """import { Parts, Sets, SetsRelics, Stats, Constants } from 'lib/constants.ts'
import { SortOption } from 'lib/optimizer/sortOptions'
Expand Down
191 changes: 146 additions & 45 deletions pdm.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "StarRailRelicScore"
version = "0.1.1"
version = "0.1.2"
description = "StarRail Relic Score Cal"
authors = [
{name = "xtaodada", email = "[email protected]"},
Expand All @@ -24,4 +24,5 @@ distribution = true
test = [
"pytest>=8.2.0",
"httpx>=0.27.0",
"black>=24.4.2",
]
4 changes: 1 addition & 3 deletions src/starrailrelicscore/data/character_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ def __init__(self):
self.load_game_data()

def load_game_data(self):
with open(
os.path.join(PATH, "game_data.json"), "r", encoding="utf-8"
) as f:
with open(os.path.join(PATH, "game_data.json"), "r", encoding="utf-8") as f:
data = json.load(f)
for character_id, _character_data in data["characters"].items():
cid = int(character_id)
Expand Down
1 change: 0 additions & 1 deletion tests/test_get_scoring_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from src.starrailrelicscore.client.db import get_scoring_metadata


@pytest.mark.asyncio
class TestScoringMetadata:
@staticmethod
def test_get_scoring_metadata_success():
Expand Down
3 changes: 0 additions & 3 deletions tests/test_score_character.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import pytest

from httpx import get
from src.starrailrelicscore.client.character import Character
from starrailrelicscore.models.mihomo import Avatar


@pytest.mark.asyncio
class TestScoreCharacter:
@staticmethod
def test_get_mihomo_data():
Expand Down

0 comments on commit 392fcfc

Please sign in to comment.