Skip to content

Commit

Permalink
ci: fix tox on Windows (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Apr 12, 2024
1 parent 12506aa commit 91de27d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/python.yaml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
@@ -1,2 +1,2 @@
poetry 1.7.1
pre-commit 3.3.2
pre-commit 3.7.0

0 comments on commit 91de27d

Please sign in to comment.