Skip to content

lightning-latest-rc #1271

lightning-latest-rc

lightning-latest-rc #1271

# Workflow template for testing plugins against PennyLane release candidate
name: lightning-latest-rc
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
PLUGIN_REPO: PennyLaneAI/pennylane-lightning
PLUGIN_BRANCH: master
PLUGIN_PACKAGE: pennylane_lightning
PENNYLANE_BRANCH: master
GCC_VERSION: 11
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
pl_backend: ["lightning_qubit", "lightning_kokkos"]
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install buildtools & compilers
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-${{ env.GCC_VERSION }} g++-${{ env.GCC_VERSION }} ninja-build
- name: Install requirements
run: |
pip install --upgrade pip
pip install --upgrade pybind11
pip install 'pytest<8.1.0'
pip install pytest-mock pytest-cov flaky pytest-benchmark
pip freeze
- name: Install PennyLane
run: |
pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.38.0-rc0
- uses: actions/checkout@v2
with:
repository: ${{ env.PLUGIN_REPO }}
path: plugin_repo
ref: ${{ env.PLUGIN_BRANCH }}
- name: Install Plugin
run: |
cd plugin_repo
SKIP_COMPILATION=True PL_BACKEND=lightning_qubit pip install . -vv
PL_BACKEND=${{ matrix.pl_backend }} pip install . -vv
- name: Run PennyLane device integration tests
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000
- name: Run plugin tests
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest plugin_repo/tests --tb=short