Repository navigation
Fix underflow rounding for formats without subnormals #304
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2024 Graphcore Ltd. All rights reserved. | |
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| pytest-container: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install requirements | |
| run: | | |
| pip install -U pip | |
| pip install .[dev] | |
| - name: Log installed environment | |
| run: | | |
| python3 -m pip freeze | |
| - name: Pre-commit all files | |
| run: | | |
| pre-commit run --all-files | |
| - name: Run unit tests | |
| run: | | |
| pytest -vv . | |
| - name: MyPy | |
| run: | | |
| mypy --disallow-untyped-defs --enable-error-code redundant-expr src test | |
| - name: Ensure that docs build | |
| run: | | |
| cd docs && make html | |
| pytest-linux-container: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch_name: linux/386 | |
| qemu_platform: 386 | |
| image_name: gfloat-linux-386:py310-uv | |
| image_tar: /tmp/gfloat-linux-386-image.tar | |
| cache_prefix: linux-386-image | |
| test_script: etc/test-linux-386.sh | |
| - arch_name: linux/arm32 | |
| qemu_platform: arm | |
| image_name: gfloat-linux-arm32:py310-uv | |
| image_tar: /tmp/gfloat-linux-arm32-image.tar | |
| cache_prefix: linux-arm32-image | |
| test_script: etc/test-linux-arm32.sh | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Restore cached test image (${{ matrix.arch_name }}) | |
| id: cache-test-image | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ matrix.image_tar }} | |
| key: ${{ runner.os }}-${{ matrix.cache_prefix }}-${{ hashFiles('etc/linux-container.Dockerfile', 'requirements.txt', 'requirements-dev.txt', 'pyproject.toml') }} | |
| - name: Enable QEMU emulation (${{ matrix.arch_name }}) | |
| uses: docker/setup-qemu-action@v4 | |
| with: | |
| platforms: ${{ matrix.qemu_platform }} | |
| - name: Load cached test image (${{ matrix.arch_name }}) | |
| run: | | |
| if [ -f "${{ matrix.image_tar }}" ]; then | |
| docker load -i "${{ matrix.image_tar }}" | |
| fi | |
| - name: Ensure test image is available (${{ matrix.arch_name }}) | |
| id: ensure-test-image | |
| run: | | |
| bash "${{ matrix.test_script }}" load | |
| - name: Run unit tests (${{ matrix.arch_name }}) | |
| run: | | |
| bash "${{ matrix.test_script }}" run -vv test | |
| - name: Save test image to cache path (${{ matrix.arch_name }}) | |
| if: ${{ !cancelled() && steps.ensure-test-image.outcome == 'success' }} | |
| run: | | |
| docker image inspect "${{ matrix.image_name }}" >/dev/null 2>&1 | |
| docker save "${{ matrix.image_name }}" -o "${{ matrix.image_tar }}" |