Skip to content

Commit

Permalink
Merge pull request #1 from qiskit-community/ci
Browse files Browse the repository at this point in the history
add GitHub Actions
  • Loading branch information
kevinsung authored Jul 30, 2024
2 parents 3070e25 + dd93c42 commit 5ee1dbf
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 1 deletion.
88 changes: 88 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: check

on:
push:
branches:
- main
tags:
- "*"
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: |
tox run -e py${{ matrix.python-version }}
test-macos:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: |
tox run -e py${{ matrix.python-version }}
test-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: |
tox run -e py${{ matrix.python-version }}
check:
runs-on: ubuntu-latest
strategy:
matrix:
tox-env: ["coverage", "type", "lint", "format"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tox environment
shell: bash
run: |
tox run -e ${{ matrix.tox-env }}
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ requires-python = ">=3.10"
dependencies = ["qiskit", "quimb"]

[project.optional-dependencies]
dev = ["mypy", "pytest", "qiskit[visualization]", "ruff"]
dev = ["coverage", "mypy", "pytest", "qiskit[visualization]", "ruff"]

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.mypy]
ignore_missing_imports = true
files = ["src/**/*.py", "tests/**/*.py"]

[tool.ruff]
include = [
"pyproject.toml",
Expand Down
46 changes: 46 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[tox]
minversion = 4.6.0
env_list =
py{310,311,312}
coverage
type
lint
format

[testenv]
description = run tests
package = wheel
wheel_build_env = .pkg
extras =
dev
commands =
pytest {posargs}

[testenv:coverage]
description = check test coverage
extras =
dev
commands =
coverage run --source qiskit_quimb -m pytest {posargs}
coverage report --fail-under=80

[testenv:type]
description = run type check
extras =
dev
commands =
mypy

[testenv:lint]
description = check for lint
extras =
dev
commands =
ruff check

[testenv:format]
description = check formatting
extras =
dev
commands =
ruff format --check

0 comments on commit 5ee1dbf

Please sign in to comment.