Skip to content

Wip nxdrive 2861 fix behavior when not entering the correct url format sourcery (Sourcery refactored) #4970

Wip nxdrive 2861 fix behavior when not entering the correct url format sourcery (Sourcery refactored)

Wip nxdrive 2861 fix behavior when not entering the correct url format sourcery (Sourcery refactored) #4970

Workflow file for this run

name: Unit tests
on:
pull_request:
paths:
- ".github/workflows/unit_tests.yml"
- "nxdrive/**/*.py"
- "tests/*.py"
- "tests/unit/*.py"
- "tools/deps/*.txt"
push:
branches: [master]
paths:
- "nxdrive/**/*.py"
- "tests/*.py"
- "tests/unit/*.py"
jobs:
unit-tests-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9 # XXX_PYTHON
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- uses: actions/cache@v3
with:
path: .tox
key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Unit tests
run: tox -e unit
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/codecov-action@v3.1.4
with:
files: ./coverage.xml
flags: unit
env_vars: OS,PYTHON
unit-tests-macos:
runs-on: "macos-latest"
env:
SYSTEM_VERSION_COMPAT: 0
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9 # XXX_PYTHON
- uses: actions/cache@v3
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- uses: actions/cache@v3
with:
path: .tox
key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Unit tests
run: tox -e unit
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/codecov-action@v3.1.4
with:
files: ./coverage.xml
flags: unit
env_vars: OS,PYTHON
unit-tests-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9 # XXX_PYTHON
architecture: "x86"
- uses: actions/cache@v3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
# Cannot be used for now: OSError: [WinError 193] %1 is not a valid Win32 application
# - uses: actions/cache@v3
# with:
# path: .tox
# key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
# restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Unit tests
run: tox -e unit
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/codecov-action@v3.1.4
with:
files: ./coverage.xml
flags: unit
env_vars: OS,PYTHON