Skip to content

Commit

Permalink
add runner for catalyst tests, install catalyst from test pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro committed Jun 20, 2024
1 parent cf62c16 commit 138c24f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/install_deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ inputs:
description: Indicate if PennyLane-Lightning should be installed from the master branch
required: false
default: 'true'
install_catalyst_test_pypi:
description: Indicate if catalyst should be installed from the test pypi location
required: false
type: boolean
default: false
additional_pip_packages:
description: Additional packages to install. Values will be passed to pip install {value}
required: false
Expand Down Expand Up @@ -100,6 +105,11 @@ runs:
if: inputs.install_pennylane_lightning_master == 'true'
run: pip install -i https://test.pypi.org/simple/ PennyLane-Lightning --pre --upgrade

- name: Install Catalyst from Test Pypi
shell: bash
if: inputs.install_catalyst_test_pypi
run: pip install -i https://test.pypi.org/simple/ PennyLane-Catalyst==0.7.0.dev0 --upgrade;

- name: Freeze dependencies
shell: bash
if: inputs.requirements_file != ''
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,38 @@ jobs:
requirements_file: ${{ strategy.job-index == 0 && 'all_interfaces.txt' || '' }}
disable_new_opmath: ${{ inputs.disable_new_opmath }}

catalyst-tests:
needs:
- setup-ci-load
strategy:
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).catalyst-tests
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default
}}
matrix:
python-version: >-
${{
fromJSON(needs.setup-ci-load.outputs.python-version).catalyst-tests
|| fromJSON(needs.setup-ci-load.outputs.python-version).default
}}
if: ${{ !contains(fromJSON(needs.setup-ci-load.outputs.jobs-to-skip), 'catalyst-tests') }}
uses: ./.github/workflows/unit-test.yml
with:
job_name: catalyst-tests (${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: catalyst-tests-coverage
python_version: ${{ matrix.python-version }}
pipeline_mode: ${{ inputs.pipeline_mode }}
install_jax: true
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: True
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: catalyst
additional_pip_packages: matplotlib
requirements_file: ${{ strategy.job-index == 0 && 'catalyst.txt' || '' }}
disable_new_opmath: ${{ inputs.disable_new_opmath }}

external-libraries-tests:
needs:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ on:
required: false
type: boolean
default: true
install_catalyst_test_pypi:
description: Indicate if catalyst should be installed from the test pypi location
required: false
type: boolean
default: false
pytest_test_directory:
description: The directory where the PennyLane tests are that should be run by PyTest
required: false
Expand Down Expand Up @@ -148,6 +153,7 @@ jobs:
install_jax: ${{ inputs.install_jax }}
additional_pip_packages: ${{ inputs.additional_pip_packages }}
install_pennylane_lightning_master: ${{ inputs.install_pennylane_lightning_master }}
install_catalyst_test_pypi: ${{ inputs.install_catalyst_test_pypi }}
requirements_file: ${{ inputs.requirements_file }}

- name: Set PyTest Args
Expand Down

0 comments on commit 138c24f

Please sign in to comment.