From 8a812e21c3db570b269ecad2a4716a150624a3e9 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Wed, 13 Nov 2024 21:36:54 -0500 Subject: [PATCH] Add CI system Test on all operating system and python version combinations Don't test the notebooks; just see if we can get all dependencies to install The challenge A notebook requires a token, and the challenge B notebook takes more than 5 minutes to run a cell on my notebook. So, as a first step, let's just use CI to ensure that all dependencies can be installed on all platforms successfully. Make the tox environment do nothing This way, it at least installs the deps Drop python 3.9 as a supported version ``` INFO: pip is looking at multiple versions of qiskit-ibm-catalog to determine which version is compatible with other requirements. This could take a while. The conflict is caused by: The user requested qiskit_serverless qiskit-ibm-catalog 0.0.0 depends on qiskit-serverless>=0.14.2 ``` --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ tox.ini | 15 +++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 tox.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..184ae7e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Tests + +on: + push: + branches: + - main + - 'stable/**' + pull_request: + branches: + - main + - 'stable/**' + schedule: + - cron: '0 1 * * *' + +jobs: + tests: + name: tests (${{ matrix.os }}, ${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + max-parallel: 4 + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Test using tox environment + run: | + tox -e py diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..82f57da --- /dev/null +++ b/tox.ini @@ -0,0 +1,15 @@ +[tox] +envlist = py{310,311,312} +skipsdist = true + +[testenv] +commands = + #pytest --nbmake --nbmake-timeout=300 {posargs} +deps = + -r requirements.txt + pytest + pytest-randomly + nbmake + +[pytest] +addopts = --durations=10