durandtibo/hya

View on GitHub
.github/workflows/test-deps.yaml

Summary

Maintainability
Test Coverage
name: Test - Dependencies
on:
  workflow_call:
  workflow_dispatch:  # to trigger manually

jobs:
  omegaconf:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    strategy:
      max-parallel: 8
      fail-fast: false
      matrix:
        os: [ ubuntu-latest ]
        python-version: [ '3.13', '3.12', '3.11' , '3.10', '3.9' ]
        omegaconf-version: [ 2.3.0, 2.2.3, 2.2.1 ]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install Poetry
        uses: snok/install-poetry@v1

      - name: Set environment variable
        run: |
          echo $(poetry run poetry env info --path)/bin >> $GITHUB_PATH

      - name: Install packages
        run: |
          make config-poetry
          make install-all

      - name: Install valid package version
        uses: durandtibo/pip-install-package-action@v0.3.0
        with:
          package-name: 'omegaconf'
          package-version: ${{ matrix.omegaconf-version }}
          python-version: ${{ matrix.python-version }}

      - name: Show installed packages
        run: |
          poetry show
          poetry show --tree

      - name: Lint
        run: |
          make lint

      - name: Run unit tests
        run: |
          make unit-test-cov

  braceexpand:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    strategy:
      max-parallel: 8
      fail-fast: false
      matrix:
        os: [ ubuntu-latest ]
        python-version: [ '3.13', '3.12', '3.11' , '3.10', '3.9' ]
        braceexpand-version: [ 0.1.7 ]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install Poetry
        uses: snok/install-poetry@v1

      - name: Set environment variable
        run: |
          echo $(poetry run poetry env info --path)/bin >> $GITHUB_PATH

      - name: Install packages
        run: |
          make config-poetry
          make install-all

      - name: Install valid package version
        uses: durandtibo/pip-install-package-action@v0.3.0
        with:
          package-name: 'braceexpand'
          package-version: ${{ matrix.braceexpand-version }}
          python-version: ${{ matrix.python-version }}

      - name: Show installed packages
        run: |
          poetry show
          poetry show --tree

      - name: Lint
        run: |
          make lint

      - name: Run unit tests
        run: |
          make unit-test-cov


  numpy:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    strategy:
      max-parallel: 8
      fail-fast: false
      matrix:
        os: [ ubuntu-latest ]
        python-version: [ '3.13', '3.12', '3.11', '3.10', '3.9' ]
        numpy-version: [ 2.1.2, 2.0.2, 1.26.4, 1.25.2, 1.24.3, 1.23.5, 1.22.4, 1.21.6 ]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install Poetry
        uses: snok/install-poetry@v1

      - name: Set environment variable
        run: |
          echo $(poetry run poetry env info --path)/bin >> $GITHUB_PATH

      - name: Install packages
        run: |
          make config-poetry
          make install

      - name: Install valid package version
        uses: durandtibo/pip-install-package-action@v0.3.0
        with:
          package-name: 'numpy'
          package-version: ${{ matrix.numpy-version }}
          python-version: ${{ matrix.python-version }}

      - name: Show installed packages
        run: |
          poetry show
          poetry show --tree

      - name: Run unit tests
        run: |
          make unit-test-cov


  torch:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    strategy:
      max-parallel: 8
      fail-fast: false
      matrix:
        os: [ ubuntu-latest ]
        python-version: [ '3.12', '3.11' , '3.10', '3.9' ]
        torch-version: [ 2.4.1, 2.3.1, 2.2.2, 2.1.2, 2.0.1, 1.13.1, 1.12.1, 1.11.0 ]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install Poetry
        uses: snok/install-poetry@v1

      - name: Set environment variable
        run: |
          echo $(poetry run poetry env info --path)/bin >> $GITHUB_PATH

      - name: Install packages
        run: |
          make config-poetry
          make install-all

      - name: Install valid package version
        uses: durandtibo/pip-install-package-action@v0.3.0
        with:
          package-name: 'torch'
          package-version: ${{ matrix.torch-version }}
          python-version: ${{ matrix.python-version }}

      - name: Show installed packages
        run: |
          poetry show
          poetry show --tree

      - name: Lint
        run: |
          make lint

      - name: Run unit tests
        run: |
          make unit-test-cov