From 8f3d54db3d920836a18e2b1dd558753f20bfe821 Mon Sep 17 00:00:00 2001 From: Chris Mutel Date: Sat, 16 Dec 2023 14:19:36 +0100 Subject: [PATCH] Split CI test runners by solvers --- .github/workflows/python-test-pardiso.yml | 63 +++++++++++++++++++ ...ython-test.yml => python-test-superlu.yml} | 2 +- .github/workflows/python-test-umfpack.yml | 63 +++++++++++++++++++ pyproject.toml | 2 +- 4 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/python-test-pardiso.yml rename .github/workflows/{python-test.yml => python-test-superlu.yml} (98%) create mode 100644 .github/workflows/python-test-umfpack.yml diff --git a/.github/workflows/python-test-pardiso.yml b/.github/workflows/python-test-pardiso.yml new file mode 100644 index 0000000..d070fa0 --- /dev/null +++ b/.github/workflows/python-test-pardiso.yml @@ -0,0 +1,63 @@ +--- +# This workflow will install Python dependencies and run tests +# across operating systems, select versions of Python, and user + dev environments +# For more info see: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python 🐍 CI/CD tests + +on: + push: + branches: [main, develop] + paths-ignore: # prevents workflow execution when only these types of files are modified + - "**.md" # wildcards prevent file in any repo dir from trigering workflow + - "**.bib" + - "**.ya?ml" # captures both .yml and .yaml + - "LICENSE" + - ".gitignore" + pull_request: + branches: [main, develop] + types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs + paths-ignore: + - "**.md" + - "**.bib" + - "**.ya?ml" + - "LICENSE" + - ".gitignore" + workflow_dispatch: # also allow manual trigger, for testing purposes + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + py-version: ["3.9", "3.12"] + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + + # general Python setup + - name: Set up Python ${{ matrix.py-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.py-version }} + + - name: Update pip & install testing pkgs + run: | + python -VV + python -m pip install --upgrade pip setuptools wheel + + # install testing + - name: Install package and test deps + run: | + pip install .[testing] # install the package and the testing deps + pip install pypardiso + + - name: Test with pytest + run: | + pytest + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test-superlu.yml similarity index 98% rename from .github/workflows/python-test.yml rename to .github/workflows/python-test-superlu.yml index 093f0ab..a938493 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test-superlu.yml @@ -33,7 +33,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - py-version: ["3.9", "3.11"] + py-version: ["3.12"] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 diff --git a/.github/workflows/python-test-umfpack.yml b/.github/workflows/python-test-umfpack.yml new file mode 100644 index 0000000..794c92b --- /dev/null +++ b/.github/workflows/python-test-umfpack.yml @@ -0,0 +1,63 @@ +--- +# This workflow will install Python dependencies and run tests +# across operating systems, select versions of Python, and user + dev environments +# For more info see: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python 🐍 CI/CD tests + +on: + push: + branches: [main, develop] + paths-ignore: # prevents workflow execution when only these types of files are modified + - "**.md" # wildcards prevent file in any repo dir from trigering workflow + - "**.bib" + - "**.ya?ml" # captures both .yml and .yaml + - "LICENSE" + - ".gitignore" + pull_request: + branches: [main, develop] + types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs + paths-ignore: + - "**.md" + - "**.bib" + - "**.ya?ml" + - "LICENSE" + - ".gitignore" + workflow_dispatch: # also allow manual trigger, for testing purposes + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + py-version: ["3.12"] + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + + # general Python setup + - name: Set up Python ${{ matrix.py-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.py-version }} + + - name: Update pip & install testing pkgs + run: | + python -VV + python -m pip install --upgrade pip setuptools wheel + + # install testing + - name: Install package and test deps + run: | + pip install .[testing] # install the package and the testing deps + pip install scikit-umfpack + + - name: Test with pytest + run: | + pytest + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 diff --git a/pyproject.toml b/pyproject.toml index 57eef9b..6c20dd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,9 +42,9 @@ tracker = "https://github.com/brightway-lca/brightway2-calc/issues" testing = [ "bw2calc", "bw2data>=4.0.DEV32", - "pypardiso", "pytest", "pytest-cov", + "pytest-randomly", "python-coveralls" ] dev = [