Allow identifiers in measureExpression
#552
Workflow file for this run
This file contains 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
name: Reference Python Package | |
on: | |
[push, pull_request] | |
jobs: | |
build: | |
uses: ./.github/workflows/build-ast.yml | |
tests: | |
name: ANTLR AST tests | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# Just using minimum and maximum to avoid exploding the matrix. | |
python-version: ['3.7', '3.10'] | |
antlr-version: ['4.7', '4.13'] | |
defaults: | |
run: | |
working-directory: source/openqasm | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: openqasm3-python-wheel | |
path: ./source/openqasm/ | |
- name: Install package | |
run: | | |
set -e | |
pip install --upgrade pip wheel | |
pip install -r requirements-dev.txt | |
pip install 'antlr4_python3_runtime==${{ matrix.antlr-version }}' | |
pip install "$(echo openqasm3-*.whl)[all]" | |
- name: Check format | |
run: black --check --diff openqasm3 tests | |
- name: Check style | |
run: pylint openqasm3 tests | |
- name: Run tests | |
run: | | |
# Swap into the testing directory so the imported `openqasm3` is the | |
# wheel version not the current-directory version. The | |
# `--import-mode=importlib` stops pytest from modifying the path to | |
# accidentally put the checked-out version (with no ANTLR) back. | |
cd tests | |
pytest -vv --color=yes --import-mode=importlib . | |
docs: | |
name: Documentation build | |
needs: build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: source/openqasm | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: openqasm3-python-wheel | |
path: ./source/openqasm/ | |
- name: Install package | |
run: | | |
set -e | |
pip install --upgrade pip wheel | |
pip install -r requirements-dev.txt | |
pip install "$(echo openqasm3-*.whl)[all]" | |
- name: Build documentation | |
working-directory: source/openqasm/docs | |
run: make html | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: openqasm3-html-documentation | |
path: source/openqasm/docs/_build/html/* | |
if-no-files-found: error |