Skip to content

[pre-commit.ci] pre-commit suggestions #122

[pre-commit.ci] pre-commit suggestions

[pre-commit.ci] pre-commit suggestions #122

Workflow file for this run

name: CI complete testing
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request: {}
jobs:
pytester:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macOS-13", "windows-2022"]
python-version: ["3.9"]
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt -r tests/requirements.txt \
--find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip list
shell: bash
- name: Tests
run: |
python -m pytest . -v --cov=kaggle_imsegm
- name: Statistics
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: always()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
with:
file: coverage.xml
flags: cpu,pytest,python${{ matrix.python-version }}
fail_ci_if_error: false
testing-guardian:
runs-on: ubuntu-latest
needs: pytester
if: always()
steps:
- run: echo "${{ needs.pytester.result }}"
- name: failing...
if: needs.pytester.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result)
timeout-minutes: 1
run: sleep 90