Cleanup Windows Action #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run unit tests | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- current-release | ||
- "*LTS" | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
jobs: | ||
run_linux_unit_tests: | ||
name: "Linux - ${{ matrix.config.tox-env }}" | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- { python-version: "3.8", tox-env: py38 } | ||
- { python-version: "3.8", tox-env: py38-no-ext } | ||
- { python-version: "3.9", tox-env: py39 } | ||
- { python-version: "3.9", tox-env: py39-no-ext } | ||
- { python-version: "3.10", tox-env: py310 } | ||
- { python-version: "3.10", tox-env: py310-no-ext } | ||
- { python-version: "3.11", tox-env: py311 } | ||
- { python-version: "3.11", tox-env: py311-no-ext } | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python ${{ matrix.config.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.config.python-version }} | ||
- name: Install tox | ||
run: pip install tox | ||
- name: Run unit tests | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: tox -e ${{ matrix.config.tox-env }} | ||
run_windows_unit_tests: | ||
name: "Windows - ${{ matrix.config.tox-env }}" | ||
if: github.event.pull_request.draft == false | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- { python-version: "3.8", tox-env: py38-no-ext } | ||
- { python-version: "3.9", tox-env: py39-no-ext } | ||
- { python-version: "3.10", tox-env: py310-no-ext } | ||
- { python-version: "3.11", tox-env: py310-no-ext } | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python ${{ matrix.config.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.config.python-version }} | ||
- name: Install tox | ||
run: pip install tox | ||
- name: Run unit tests | ||
run: | | ||
tox -e ${{ matrix.config.tox-env }} | ||
if ($LASTEXITCODE -ne 0) { | ||
# Command exit code is not zero | ||
Write-Host "::warning::Unit tests failed, but exiting with success code" | ||
exit 0 | ||
} |