Spaces:
Sleeping
Sleeping
Yohaan Seth Nathan commited on
Commit ·
b0d53d6
1
Parent(s): bac2365
Minor updates to GitHub Actions
Browse files
.github/workflows/lishogi-bot-build.yml
CHANGED
|
@@ -9,6 +9,9 @@ on:
|
|
| 9 |
pull_request:
|
| 10 |
branches: [ master ]
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
jobs:
|
| 13 |
build:
|
| 14 |
|
|
@@ -16,17 +19,15 @@ jobs:
|
|
| 16 |
|
| 17 |
steps:
|
| 18 |
- uses: actions/checkout@v3
|
| 19 |
-
- name: Set up Python 3.
|
| 20 |
uses: actions/setup-python@v4
|
| 21 |
with:
|
| 22 |
-
python-version: "3.
|
| 23 |
- name: Install dependencies
|
| 24 |
run: |
|
| 25 |
python -m pip install --upgrade pip
|
| 26 |
pip install pytest pytest-timeout
|
| 27 |
pip install -r requirements.txt
|
| 28 |
- name: Test with pytest
|
| 29 |
-
env:
|
| 30 |
-
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
| 31 |
run: |
|
| 32 |
pytest tests.py -s
|
|
|
|
| 9 |
pull_request:
|
| 10 |
branches: [ master ]
|
| 11 |
|
| 12 |
+
env:
|
| 13 |
+
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
| 14 |
+
|
| 15 |
jobs:
|
| 16 |
build:
|
| 17 |
|
|
|
|
| 19 |
|
| 20 |
steps:
|
| 21 |
- uses: actions/checkout@v3
|
| 22 |
+
- name: Set up Python 3.11
|
| 23 |
uses: actions/setup-python@v4
|
| 24 |
with:
|
| 25 |
+
python-version: "3.11"
|
| 26 |
- name: Install dependencies
|
| 27 |
run: |
|
| 28 |
python -m pip install --upgrade pip
|
| 29 |
pip install pytest pytest-timeout
|
| 30 |
pip install -r requirements.txt
|
| 31 |
- name: Test with pytest
|
|
|
|
|
|
|
| 32 |
run: |
|
| 33 |
pytest tests.py -s
|
.github/workflows/python-build.yml
CHANGED
|
@@ -16,7 +16,7 @@ jobs:
|
|
| 16 |
strategy:
|
| 17 |
matrix:
|
| 18 |
os: [ubuntu-latest, macos-latest, windows-latest]
|
| 19 |
-
python: [3.7,
|
| 20 |
|
| 21 |
steps:
|
| 22 |
- uses: actions/checkout@v3
|
|
|
|
| 16 |
strategy:
|
| 17 |
matrix:
|
| 18 |
os: [ubuntu-latest, macos-latest, windows-latest]
|
| 19 |
+
python: [3.7, "3.11"]
|
| 20 |
|
| 21 |
steps:
|
| 22 |
- uses: actions/checkout@v3
|
tests.py
CHANGED
|
@@ -29,7 +29,7 @@ def download_yo():
|
|
| 29 |
|
| 30 |
def run_bot(CONFIG, logging_level):
|
| 31 |
lishogi_bot.logger.info(lishogi_bot.intro())
|
| 32 |
-
li = lishogi_bot.lishogi.Lishogi(
|
| 33 |
|
| 34 |
user_profile = li.get_profile()
|
| 35 |
username = user_profile["username"]
|
|
@@ -96,6 +96,7 @@ def test_bot():
|
|
| 96 |
lishogi_bot.logger.info("Downloaded YaneuraOu for NNUE")
|
| 97 |
with open("./config.yml.default") as file:
|
| 98 |
CONFIG = yaml.safe_load(file)
|
|
|
|
| 99 |
CONFIG["engine"]["dir"] = "./"
|
| 100 |
CONFIG["engine"]["name"] = "yo.exe"
|
| 101 |
CONFIG["engine"]["usi_options"]["BookFile"] = "no_book"
|
|
@@ -104,4 +105,4 @@ def test_bot():
|
|
| 104 |
|
| 105 |
|
| 106 |
if __name__ == "__main__":
|
| 107 |
-
test_bot()
|
|
|
|
| 29 |
|
| 30 |
def run_bot(CONFIG, logging_level):
|
| 31 |
lishogi_bot.logger.info(lishogi_bot.intro())
|
| 32 |
+
li = lishogi_bot.lishogi.Lishogi(CONFIG["token"], CONFIG["url"], lishogi_bot.__version__, logging_level)
|
| 33 |
|
| 34 |
user_profile = li.get_profile()
|
| 35 |
username = user_profile["username"]
|
|
|
|
| 96 |
lishogi_bot.logger.info("Downloaded YaneuraOu for NNUE")
|
| 97 |
with open("./config.yml.default") as file:
|
| 98 |
CONFIG = yaml.safe_load(file)
|
| 99 |
+
CONFIG["token"] = TOKEN
|
| 100 |
CONFIG["engine"]["dir"] = "./"
|
| 101 |
CONFIG["engine"]["name"] = "yo.exe"
|
| 102 |
CONFIG["engine"]["usi_options"]["BookFile"] = "no_book"
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
| 108 |
+
test_bot()
|