From 6b7c477525671e72f336940b6fa5888442f49a68 Mon Sep 17 00:00:00 2001 From: Sylvain Brunato Date: Tue, 24 Sep 2024 17:38:18 +0200 Subject: [PATCH] ci: mypy in linting github action --- .github/workflows/test.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea10ca3bd..304b17ddd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: jobs: lint: - name: Linting (pre-commit) + name: Linting (pre-commit and mypy) runs-on: ubuntu-latest steps: - name: Checkout the repo @@ -24,8 +24,25 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: Run pre-commit action - uses: pre-commit/action@v3.0.1 + - name: Update pip + run: python -m pip install --upgrade pip + - name: Get pip cache dir + id: pip-cache + shell: bash + run: echo "DIR=$(pip cache dir)" >> $GITHUB_OUTPUT + - name: Get current week number + id: get-week + shell: bash + run: echo "WEEK=$(date +'%V')" >> $GITHUB_OUTPUT + - name: Pip cache + uses: actions/cache@v4 + with: + path: ${{ steps.pip-cache.outputs.DIR }} + key: ${{ runner.os }}-pip-${{ steps.get-week.outputs.WEEK }}-${{ hashFiles('setup.cfg') }} + - name: Install tox + run: python -m pip install tox + - name: Run linters with tox + run: python -m tox -e linters tests: name: Test it!