From dfcbcd7ff2230b37cd7c2c9cd5c264c6e1e75b36 Mon Sep 17 00:00:00 2001 From: ToasterUwU Date: Sun, 24 Sep 2023 00:24:17 +0200 Subject: [PATCH] feat(github): add dependabot and lint workflows feat: add pyright to dev requirements --- .github/dependabot.yml | 6 +++++ .github/workflows/lint.yml | 53 ++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 1 + 3 files changed, 60 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/lint.yml create mode 100644 requirements-dev.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f174799 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ed9d580 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,53 @@ +name: lint + +on: + push: + branches: + - master + pull_request: + +jobs: + pyright: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11"] + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: | + requirements.txt + requirements-dev.txt + + - name: Install dependencies + run: python -m pip install -r requirements.txt -r requirements-dev.txt + + - name: Set up pyright + run: echo "PYRIGHT_VERSION=$(python -c 'import pyright; print(pyright.__pyright_version__)')" >> $GITHUB_ENV + + - name: Run pyright (Linux) + uses: jakebailey/pyright-action@v1.2.0 + with: + version: ${{ env.PYRIGHT_VERSION }} + python-version: ${{ matrix.python-version }} + python-platform: Linux + no-comments: true + warnings: true + + - name: Run pyright (Windows) + uses: jakebailey/pyright-action@v1.0.3 + # run anyway + if: success() || failure() + with: + version: ${{ env.PYRIGHT_VERSION }} + python-version: ${{ matrix.python-version }} + python-platform: Windows + no-comments: true + warnings: true diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..ac39db9 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +pyright == 1.1.327 \ No newline at end of file