Skip to content

fix: FileBone.postSaveHandler iterates over None (#1350) #3634

fix: FileBone.postSaveHandler iterates over None (#1350)

fix: FileBone.postSaveHandler iterates over None (#1350) #3634

Workflow file for this run

name: Python
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
test:
strategy:
matrix:
python: [ "3.10", "3.11", "3.12" ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: viur
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
cd viur
python -m pip install -U pip
if [ -f tests/requirements.txt ]; then python -m pip install -r tests/requirements.txt; fi
python -m pip install -U coverage coverage-badge
- name: Run the tests
run: |
pwd
python ./viur/tests/main.py
echo $?
pwd
- name: Build Coverage
if: ${{ matrix.python == '3.12' && github.event_name == 'push' && github.ref_name == 'main' }}
working-directory: viur/tests/
run: |
# generate coverage
coverage run -m unittest discover
coverage report
coverage html
coverage-badge -fo ./htmlcov/coverage.svg
# use relative paths
find ./htmlcov/ -type f -exec \
sed -i 's:'$(dirname $(pwd))'/core/::g' {} +
# Remove .gitignore, otherwise nothing would be committed to the gh-pages branch
rm htmlcov/.gitignore
- name: Deploy Coverage
uses: peaceiris/actions-gh-pages@v3
if: ${{ matrix.python == '3.12' && github.event_name == 'push' && github.ref_name == 'main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./viur/tests/htmlcov
publish_branch: coverage-html
allow_empty_commit: true