Skip to content

Check the output of demos on the master and dev branches #156

Check the output of demos on the master and dev branches

Check the output of demos on the master and dev branches #156

name: Check the output of demos on the master and dev branches
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build-dev:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
ref: dev
- name: Run Rigetti Quilc
run: docker run --rm -d -p 5555:5555 rigetti/quilc -R
- name: Run Rigetti QVM
run: docker run --rm -d -p 5000:5000 rigetti/qvm -S
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
pip install --no-deps -r requirements_no_deps.txt
pip install --index-url https://test.pypi.org/simple/ pennylane-lightning --pre --no-deps --upgrade
- name: Build tutorials
run: |
make download
make html
zip -r /tmp/qml_demos.zip demos
- uses: actions/upload-artifact@v2
with:
name: built-website-dev
path: |
/tmp/qml_demos.zip
_build/html
build-master:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
ref: master
- name: Run Rigetti Quilc
run: docker run --rm -d -p 5555:5555 rigetti/quilc -R
- name: Run Rigetti QVM
run: docker run --rm -d -p 5000:5000 rigetti/qvm -S
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
pip install --no-deps -r requirements_no_deps.txt
pip install pennylane-lightning
- name: Build tutorials
run: |
make download
make html
zip -r /tmp/qml_demos.zip demos
- uses: actions/upload-artifact@v2
with:
name: built-website-master
path: |
/tmp/qml_demos.zip
_build/html
check-diffs:
runs-on: ubuntu-latest
needs: [build-dev, build-master]
steps:
- uses: actions/checkout@v2
with:
# We checkout a dedicated unprotected branch and store the output of
# the checker there
ref: demo_output_comparison
- name: Create dev dir
run: mkdir /tmp/dev/
- uses: actions/download-artifact@v2
with:
name: built-website-dev
path: /tmp/dev/
- name: Create master dir
run: mkdir /tmp/master/
- uses: actions/download-artifact@v2
with:
name: built-website-master
path: /tmp/master/
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Update the output file
run: |
git config user.name "QML demo checker Bot"
git config user.email "<>"
pip install pytz
python .github/workflows/generate_diffs.py
mv demo_diffs.md demo_checker
git add demo_checker/demo_diffs.md
git commit -m "Update the demonstration differences found"
git push
- uses: actions/upload-artifact@v2
with:
name: demo_diffs
path: |
demo_checker/demo_diffs.md