-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update github actions #1443
Update github actions #1443
Conversation
d2877f3
to
cc75406
Compare
Split in server and worker workflows. Set up the server workflow with the SW versions used on PROD. Set up the worker workflows to test on Linux with few python versions and on Windows msys2. See: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python https://github.com/marketplace/actions/setup-msys2
cc75406
to
139cebd
Compare
Would it be possible to test the worker also on MacOSX? There is some Mac specific code in the worker and it would be nice to be able to test it. |
That was my intention but I got an error when adding MacOSX in the workflow matrix. |
What error ? We have macos in the stockfish CI if you are interested take a look there only the avx2 compile doesn’t work for macOS ci runner |
My first implementation had python 3.5 too in the matrix (now dropped because I would like to switch to |
I got the error when using only one workflow for linux and macos, it seems that we are hitting a rate limit for url: https://api.github.com/repos/official-stockfish/books/git/trees/master https://github.com/ppigazzini/fishtest/actions/runs/3445092768/jobs/5748408359
|
I don't understand why only the macos workflow is hitting that rate limit... |
|
Perhaps we can fake the rate limit request during testing? |
The macos workflow still fails when using the github token, even with only one python version. - name: Run worker tests
run: |
./test_worker.sh
env:
GITHUB_TOKEN: ${{ github.token }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
@ppigazzini Do you have the link of that action? |
https://github.com/ppigazzini/fishtest/actions/ I wonder why we are hitting the link https://api.github.com/repos/official-stockfish/books/git/trees/master with this code: def test_item_download(self):
try:
games.download_from_github("README.md", ".")
self.assertTrue(os.path.exists(os.path.join(".", "README.md")))
except KeyError:
pass EDIT_000: because the function is in truth REPO_URL = "https://github.com/official-stockfish/books"
def download_from_github(item, testing_dir):
"""Download item from FishCooking to testing_dir"""
tree = requests_get(
github_api(REPO_URL) + "/git/trees/master", timeout=HTTP_TIMEOUT
).json()
for blob in tree["tree"]:
if blob["path"] == item:
print("Downloading {} ...".format(item))
blob_json = requests_get(blob["url"], timeout=HTTP_TIMEOUT).json()
with open(os.path.join(testing_dir, item), "wb+") as f:
f.write(b64decode(blob_json["content"]))
break
else:
raise WorkerException("Item {} not found".format(item)) |
It is strange that the github token does not work since it is officially supported. |
Doubts:
EDIT_000: switching to the fishtest repo that runs the workflow (with the github token passed to the env) failed too... def test_item_download(self):
try:
games.REPO_URL = "https://github.com/ppigazzini/fishtest"
games.download_from_github("README.md", ".")
self.assertTrue(os.path.exists(os.path.join(".", "README.md")))
except KeyError:
pass
|
This failed randomly too: - name: Run worker tests
run: |
cd worker && python setup.py test
env:
#GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} EDIT_000: failed setting a high level env too. name: CI worker posix
on: [push, pull_request, workflow_dispatch]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Maybe we can download things using raw.githubusercontent.com ? I think this is not affected by api credits. EDIT: I do not think there is a risk getting outdated content in this way. |
I made a PR. Have a look! |
Split in server and worker workflows.
Set up the server workflow with the SW versions used on PROD.
Set up the worker workflows to test on Linux with few python versions and on Windows msys2.
See:
https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
https://github.com/marketplace/actions/setup-msys2