diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests.yml similarity index 66% rename from .github/workflows/tests_linux.yml rename to .github/workflows/tests.yml index 2e60fd8aa7..3354683029 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Tests Linux +name: Tests on: push: branches: [main, 'stable/*'] @@ -32,8 +32,7 @@ jobs: run: | set -e pip install -U pip wheel - pip install -U -c constraints.txt git+https://github.com/Qiskit/qiskit-terra - pip install -U -c constraints.txt -r requirements-dev.txt + pip install -U -c constraints.txt -r requirements-dev.txt qiskit-terra numpy scipy shell: bash - name: Run Lint run: | @@ -79,11 +78,10 @@ jobs: set -e mkdir out; cd out; virtualenv aer-test aer-test/bin/pip install ../dist/*tar.gz - aer-test/bin/pip install -c ../constraints.txt git+https://github.com/Qiskit/qiskit-terra aer-test/bin/python ../tools/verify_wheels.py aer-test/bin/pip check shell: bash - tests: + tests_linux: runs-on: ${{ matrix.os }} needs: [sdist, lint] timeout-minutes: 60 @@ -111,9 +109,6 @@ jobs: ${{ runner.os }}-${{ matrix.python-version}}- - name: Install Deps run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel - - name: Install terra from source - run: python -m pip install -U -c constraints.txt git+https://github.com/Qiskit/qiskit-terra - if: matrix.python-version != '3.6' - name: Install openblas run: | set -e @@ -123,8 +118,6 @@ jobs: - name: Install Aer run: python -m pip install -U . - name: Run Tests - env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y run: | set -e pip check @@ -157,7 +150,7 @@ jobs: ${{ 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 git+https://github.com/Qiskit/qiskit-terra + run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel - name: Install openblas run: | set -e @@ -169,11 +162,93 @@ jobs: set -e python setup.py bdist_wheel -- -DTEST_JSON=1 pip install --find-links=dist qiskit-aer + - name: Run Tests + run: | + set -e + pip check + stestr run --slowest + shell: bash + tests_macos: + runs-on: ${{ matrix.os }} + needs: [sdist, lint] + timeout-minutes: 60 + strategy: + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + os: ["macOS-latest"] + env: + AER_THRUST_BACKEND: OMP + QISKIT_TEST_CAPTURE_STREAMS: 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 + stestr run --slowest + shell: bash + tests_windows: + runs-on: ${{ matrix.os }} + needs: ["lint", "sdist"] + timeout-minutes: 60 + strategy: + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + os: ["windows-2019"] + env: + AER_THRUST_BACKEND: OMP + QISKIT_TEST_CAPTURE_STREAMS: 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/setup-msbuild@v1.0.2 + - name: Install Deps + run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel + - name: Install Aer Windows + run: | + set -e + python setup.py bdist_wheel -- -G 'Visual Studio 16 2019' + pip install --find-links=dist qiskit-aer + shell: bash - name: Run Tests env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y + LANG: 'C.UTF-8' + PYTHONIOENCODING: 'utf-8:backslashreplace' run: | set -e + chcp.com 65001 pip check stestr run --slowest shell: bash diff --git a/.github/workflows/tests_mac.yml b/.github/workflows/tests_mac.yml deleted file mode 100644 index 73a9f1539d..0000000000 --- a/.github/workflows/tests_mac.yml +++ /dev/null @@ -1,176 +0,0 @@ -name: Tests MacOS -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: macOS-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 git+https://github.com/Qiskit/qiskit-terra - pip install -U -c constraints.txt -r requirements-dev.txt - shell: bash - - name: Run Lint - run: | - set -e - pycodestyle --ignore=E402,W504 --max-line-length=100 qiskit/providers/aer - pylint -j 2 -rn qiskit/providers/aer - sdist: - runs-on: ${{ matrix.platform.os }} - needs: ["lint"] - strategy: - matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] - platform: [ - { os: "macOS-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 - - name: Build Sdist - run: python setup.py 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/pip install -c ../constraints.txt git+https://github.com/Qiskit/qiskit-terra - aer-test/bin/python ../tools/verify_wheels.py - aer-test/bin/pip check - shell: bash - tests: - runs-on: ${{ matrix.os }} - needs: [sdist, lint] - timeout-minutes: 60 - strategy: - matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] - os: ["macOS-latest"] - env: - AER_THRUST_BACKEND: OMP - QISKIT_TEST_CAPTURE_STREAMS: 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 wheel git+https://github.com/Qiskit/qiskit-terra - pip install -U -c constraints.txt -r requirements-dev.txt - - name: Install Aer - run: python -m pip install -U . - - name: Run Tests - env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y - run: | - set -e - pip check - stestr run --slowest - shell: bash - if: runner.os != 'macOS' || matrix.python-version != '3.8' - - name: Run Tests macOS 3.8 - env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y - QISKIT_IN_PARALLEL: TRUE - run: | - set -e - pip check - stestr run --slowest - shell: bash - if: runner.os == 'macOS' && matrix.python-version == '3.8' - - tests-json-input: - runs-on: ${{ matrix.os }} - needs: [sdist, lint] - timeout-minutes: 60 - strategy: - matrix: - python-version: [3.9] - os: ["macOS-latest"] - env: - AER_THRUST_BACKEND: OMP - QISKIT_TEST_CAPTURE_STREAMS: 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 wheel git+https://github.com/Qiskit/qiskit-terra - pip install -U -c constraints.txt -r requirements-dev.txt - - name: Install Aer - run: | - set -e - python setup.py bdist_wheel -- -DTEST_JSON=1 - pip install --find-links=dist qiskit-aer - - name: Run Tests - env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y - run: | - set -e - pip check - stestr run --slowest - shell: bash diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml deleted file mode 100644 index 6886473902..0000000000 --- a/.github/workflows/tests_windows.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: Tests Windows -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: windows-2019 - 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: ~\AppData\Local\pip\Cache - 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 -c constraints.txt git+https://github.com/Qiskit/qiskit-terra - pip install -U -c constraints.txt -r requirements-dev.txt - shell: bash - - name: Run Lint - run: | - set -e - pycodestyle --ignore=E402,W504 --max-line-length=100 qiskit/providers/aer - pylint -j 2 -rn qiskit/providers/aer - shell: bash - sdist: - runs-on: ${{ matrix.platform.os }} - needs: ["lint"] - strategy: - matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] - platform: [ - { os: "windows-2019", python-architecture: "x64"}, - { os: "windows-2019", python-architecture: "x86"}, - ] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.python-architecture }} - - 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: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 - - name: Install Deps - run: python -m pip install -U setuptools wheel virtualenv - - name: Build Sdist - run: python setup.py sdist - - name: Install from sdist and test - run: | - set -e - mkdir out; cd out; virtualenv aer-test - aer-test/Scripts/pip install --find-links ../dist qiskit-aer - aer-test/Scripts/pip install -c ../constraints.txt git+https://github.com/Qiskit/qiskit-terra - aer-test/Scripts/python ../tools/verify_wheels.py - aer-test/Scripts/pip check - shell: bash - env: - CMAKE_GENERATOR: 'Visual Studio 16 2019' - tests: - runs-on: ${{ matrix.os }} - needs: ["lint"] - timeout-minutes: 60 - strategy: - matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] - os: ["windows-2019"] - env: - AER_THRUST_BACKEND: OMP - QISKIT_TEST_CAPTURE_STREAMS: 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/setup-msbuild@v1.0.2 - - name: Install Deps - run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel git+https://github.com/Qiskit/qiskit-terra - - name: Install Aer Windows - run: | - set -e - python setup.py bdist_wheel -- -G 'Visual Studio 16 2019' - pip install --find-links=dist qiskit-aer - shell: bash - - name: Run Tests - env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y - LANG: 'C.UTF-8' - PYTHONIOENCODING: 'utf-8:backslashreplace' - run: | - set -e - chcp.com 65001 - pip check - stestr run --slowest - shell: bash - - tests-json-input: - runs-on: ${{ matrix.os }} - needs: ["lint"] - timeout-minutes: 60 - strategy: - matrix: - python-version: [3.9] - os: ["windows-2019"] - env: - AER_THRUST_BACKEND: OMP - QISKIT_TEST_CAPTURE_STREAMS: 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/setup-msbuild@v1.0.2 - - name: Install Deps - run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel git+https://github.com/Qiskit/qiskit-terra - - name: Install Aer Windows - run: | - set -e - python setup.py bdist_wheel -- -DTEST_JSON=1 -G 'Visual Studio 16 2019' - pip install --find-links=dist qiskit-aer - shell: bash - - name: Run Tests - env: - QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y - LANG: 'C.UTF-8' - PYTHONIOENCODING: 'utf-8:backslashreplace' - run: | - set -e - pip check - chcp.com 65001 - stestr run --slowest - shell: bash