Skip to content

refactor deploy.yml #35

refactor deploy.yml

refactor deploy.yml #35

Workflow file for this run

name: Tests
on:
push:
branches: [main, 'stable/*']
pull_request:
branches: [main, 'stable/*']
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-lint-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-lint-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install deps
run: |
set -e
pip install -U pip wheel
pip install -U -c constraints.txt -r requirements-dev.txt qiskit-terra numpy scipy
shell: bash
- name: Run clang-format
run: |
set -e
sh tools/clang-format.sh --Werror -n
shell: bash
- name: Run Lint
run: |
set -e
black --check qiskit_aer test tools setup.py
pylint -j 2 -rn qiskit_aer
sdist:
runs-on: ${{ matrix.platform.os }}
needs: ["lint"]
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11']
platform: [
{ os: "ubuntu-latest", python-architecture: "x64" },
]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-sdist-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-sdist-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: python -m pip install -U setuptools wheel virtualenv build
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Build Sdist
run: python -I -m build --sdist
- name: Install from sdist and test
run: |
set -e
mkdir out; cd out; virtualenv aer-test
aer-test/bin/pip install ../dist/*tar.gz
aer-test/bin/python ../tools/verify_wheels.py
aer-test/bin/pip check
shell: bash
tests_linux:
runs-on: ${{ matrix.os }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
os: ["ubuntu-latest"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Install Aer
run: |
python -m pip install -U .
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests-json-input:
runs-on: ${{ matrix.os }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.9]
os: ["ubuntu-latest"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel build
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Install Aer
run: |
set -e
python -I -m build --wheel --config-setting=--build-option=-- --config-setting=--build-option=-DTEST_JSON=1
pip install --find-links=dist qiskit-aer
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests_macos:
runs-on: ${{ matrix.os }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11']
os: ["macOS-latest"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: |
set -e
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Install Aer
run: python -m pip install -U .
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests_windows:
runs-on: ${{ matrix.os }}
needs: ["lint", "sdist"]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
os: ["windows-2019"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install Deps
run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel build
- name: Install Aer Windows
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
run: |
set -e
python -I -m build --wheel
pip install --find-links=dist qiskit-aer
shell: bash
- name: Run Tests
env:
LANG: 'C.UTF-8'
PYTHONIOENCODING: 'utf-8:backslashreplace'
run: |
set -e
chcp.com 65001
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash