Skip to content

Fix test_annotation_pipeline fails with half-precision-model=True #1573

Fix test_annotation_pipeline fails with half-precision-model=True

Fix test_annotation_pipeline fails with half-precision-model=True #1573

Workflow file for this run

name: Code Quality and Tests
on:
push:
branches: [main]
pull_request:
branches: [main, "release/*"]
env:
FORCE_COLOR: "1"
jobs:
pre-commit:
name: Pre-commit
runs-on: "ubuntu-latest"
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up python environment
uses: ./.github/actions/init-env
with:
os: "ubuntu-latest"
python: "3.9"
- name: Compute pre-commit cache key
id: pre-commit-cache
shell: python
run: |
import hashlib
import sys
import os
python = "py{}.{}".format(*sys.version_info[:2])
payload = sys.version.encode() + sys.executable.encode()
digest = hashlib.sha256(payload).hexdigest()
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
with open(os.environ['GITHUB_OUTPUT'], 'a') as f: f.write(f"result={result}\n")
- name: Restore pre-commit cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ steps.pre-commit-cache.outputs.result }}-
- name: Run pre-commits
run: |
source .venv/bin/activate
pre-commit run -a
shell: bash
pytest:
name: Pytest ${{ matrix.python }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { python: "3.9", os: "ubuntu-latest" }
# - { python: "3.9", os: "macos-latest" }
# - { python: "3.9", os: "windows-latest" }
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up python environment
uses: ./.github/actions/init-env
with:
os: ${{ matrix.os }}
python: ${{ matrix.python }}
- name: Run tests with coverage
run: |
source .venv/bin/activate
pytest --cov --cov-report=xml:coverage.xml --cov-report=term-missing --typeguard-packages=pytorch-ie
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}