From 91de27ddcb5f926415be6bf057206c31344edbb7 Mon Sep 17 00:00:00 2001 From: "W. Augusto Andreoli" Date: Sat, 13 Apr 2024 00:09:16 +0200 Subject: [PATCH] ci: fix tox on Windows (#652) --- .github/workflows/python.yaml | 16 ++++++++++++++-- .tool-versions | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c0f05ad0..568bc128 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -51,14 +51,26 @@ jobs: - name: Install tox run: python -m pip install tox - - name: "Set lint/docs env var" + - name: "Set LINT_DOCS" if: matrix.python-version == '3.9' run: | echo "LINT_DOCS=,lint,docs" >> $GITHUB_ENV + - name: "Set TOX_ENV on Windows" + if: matrix.os == 'windows-latest' + run: | + $pythonVersion = "${{ matrix.python-version }}" + $TOX_ENV = "py" + $pythonVersion.Replace('.', '') + echo "TOX_ENV=$TOX_ENV" | Out-File -FilePath $env:GITHUB_ENV -Append + + - name: "Set TOX_ENV on Linux/macOS" + if: matrix.os != 'windows-latest' + run: | + echo "TOX_ENV=$(echo py${{ matrix.python-version }} | tr -d .)" >> $GITHUB_ENV + - name: "Run tests on ${{ matrix.os }}" run: | - tox -e clean,$(echo py${{ matrix.python-version }} | tr -d .)${{env.LINT_DOCS}},report + tox -e clean,${{env.TOX_ENV}}${{env.LINT_DOCS}},report # https://github.com/marketplace/actions/coveralls-python # The official coverallsapp/github-action@master doesn't work: https://github.com/marketplace/actions/coveralls-github-action diff --git a/.tool-versions b/.tool-versions index e71db6b5..dbdabba2 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ poetry 1.7.1 -pre-commit 3.3.2 +pre-commit 3.7.0