diff --git a/.github/workflows/test-auth.yml b/.github/workflows/test-auth.yml new file mode 100644 index 0000000..e5fe8c6 --- /dev/null +++ b/.github/workflows/test-auth.yml @@ -0,0 +1,29 @@ +name: Test Auth + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +jobs: + auth: + runs-on: ubuntu-latest + timeout-minutes: 5 + + env: + RIOT_USERNAME: ${{ secrets.RIOT_USERNAME }} + RIOT_PASSWORD: ${{ secrets.RIOT_PASSWORD }} + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + + - run: | + python -m pip install --upgrade pip + pip install git+https://github.com/floxay/python-riot-auth.git + + - run: python ./.github/workflows/test-auth/script.py diff --git a/.github/workflows/test-auth/script.py b/.github/workflows/test-auth/script.py new file mode 100644 index 0000000..e5bc75e --- /dev/null +++ b/.github/workflows/test-auth/script.py @@ -0,0 +1,14 @@ +import asyncio +import os + +import riot_auth + + +USERNAME = os.getenv("RIOT_USERNAME") +assert USERNAME +PASSWORD = os.getenv("RIOT_PASSWORD") +assert PASSWORD + +auth = riot_auth.RiotAuth() +asyncio.run(auth.authorize(username=USERNAME, password=PASSWORD)) +assert auth.user_id