Skip to content

Fix/distutil deprecation #1215

Fix/distutil deprecation

Fix/distutil deprecation #1215

Workflow file for this run

name: Workflow for Codecov
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
codecov-python-39:
runs-on: windows-latest
env:
PYTHONTRACEMALLOC: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: pip install coverage
- name: Run extension tests
continue-on-error: true
shell: cmd
run: |
cd ./src/extension/tests
echo '===============START EXTENSION TESTS...===============' >> ../../../err.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err.txt
echo '===============FINISH EXTENSION TESTS...===============' >> ../../../err.txt
- name: Run core tests
continue-on-error: true
shell: cmd
run: |
cd ./src/core/tests
echo '===============START CORE TESTS...===============' >> ../../../err.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err.txt
echo '===============FINISH CORE TESTS...===============' >> ../../../err.txt
- name: Collect coverage
run: |
cd ./src/core/tests
coverage xml
cd ../../extension/tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
flags: python39
name: python-39
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Read test output and Check if all tests passed
shell: bash
run: |
CONTENTS=$(cat err.txt)
if echo "$CONTENTS" | grep -q 'FAILED (failures='; then
echo "There are failed tests"
echo "Contents: $CONTENTS"
exit 1
fi
codecov-python-27:
runs-on: windows-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
needs: codecov-python-39
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore Python 2.7 cache
uses: actions/cache@v4
with:
path: C:\Python27
key: python27-cache
- name: Install Python 2.7
shell: cmd
run: |
echo "check if python27 is not cached"
if not exist C:\Python27 (
choco install python2 -y
SETX PATH "%PATH%;C:\Python27"
)
- name: Cache dependencies
uses: actions/cache@v4
with:
path: '%UserProfile%\.cache\pip'
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
shell: cmd
run: pip install -r .github/workflows/requirements.txt
- name: Run extension tests
continue-on-error: true
shell: cmd
run: |
cd ./src/extension/tests
echo '===============START EXTENSION TESTS...===============' >> ../../../err2.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err2.txt
echo '===============FINISH EXTENSION TESTS...===============' >> ../../../err2.txt
- name: Run core tests
continue-on-error: true
shell: cmd
run: |
cd ./src/core/tests
echo '===============START CORE TESTS...===============' >> ../../../err2.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err2.txt
echo '===============FINISH CORE TESTS...===============' >> ../../../err2.txt
- name: Collect coverage
run: |
cd ./src/core/tests
coverage xml
cd ../../extension/tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
flags: python27
name: python-27
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Read test output and Check if all tests passed
shell: bash
run: |
CONTENTS=$(cat err2.txt)
if echo "$CONTENTS" | grep -q 'FAILED (failures='; then
echo "There are failed tests"
echo "Contents: $CONTENTS"
exit 1
fi