From 0d02a6344be5b6512edcec213016719fdbb9c70d Mon Sep 17 00:00:00 2001 From: pajlada Date: Fri, 7 Feb 2025 23:01:05 +0100 Subject: [PATCH] chore(eventsub): run pytest in ci (#5920) --- .github/workflows/test.yml | 30 +++++++++++++++++++ .../ast/requirements-dev.txt | 7 +++-- lib/twitch-eventsub-ws/ast/requirements.txt | 12 ++++++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2cacdcd..12ab97c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -100,3 +100,33 @@ jobs: plugins: gcov fail_ci_if_error: true verbose: true + + eventsub-test: + name: "EventSub python test" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install dependencies + run: | + sudo apt update + sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install \ + python3 python3-venv clang-18 clang-format-18 libclang-18-dev + echo "LIBCLANG_LIBRARY_FILE=/usr/lib/x86_64-linux-gnu/libclang-18.so" >> "$GITHUB_ENV" + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 42 + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 42 + + - name: Setup virtual environment + run: | + python3 -m venv venv + ./venv/bin/pip3 install -r requirements.txt + ./venv/bin/pip3 install -r requirements-dev.txt + working-directory: lib/twitch-eventsub-ws/ast + + - name: Run pytest + run: | + ./venv/bin/pytest + working-directory: lib/twitch-eventsub-ws/ast diff --git a/lib/twitch-eventsub-ws/ast/requirements-dev.txt b/lib/twitch-eventsub-ws/ast/requirements-dev.txt index e95b7aca..9a984b20 100644 --- a/lib/twitch-eventsub-ws/ast/requirements-dev.txt +++ b/lib/twitch-eventsub-ws/ast/requirements-dev.txt @@ -1,4 +1,7 @@ +# Test runner - run pytest in this dir to run tests +pytest==8.3.4 + black==23.3.0 -flake8==6.0.0 -mypy==1.3.0 +flake8==7.1.1 +mypy==1.15.0 isort==5.12.0 diff --git a/lib/twitch-eventsub-ws/ast/requirements.txt b/lib/twitch-eventsub-ws/ast/requirements.txt index a3e94456..17b20ae8 100644 --- a/lib/twitch-eventsub-ws/ast/requirements.txt +++ b/lib/twitch-eventsub-ws/ast/requirements.txt @@ -1,6 +1,12 @@ +# parsing of header files clang==15.0.7 -Jinja2==3.1.2 + +# ensures formatting of generated files is consistent +clang-format==16.0.6 + +# used for generating the code +Jinja2==3.1.5 jinja2-workarounds==0.1.0 -clang-format==16.0.4 + +# colors for logging colorama==0.4.6 -pytest==7.3.1