tests #184
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: tests | |
| on: | |
| push: | |
| paths-ignore: | |
| - "docs/**" | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Latest Python 3.14" | |
| os: ubuntu-latest | |
| python-version: "3.14" | |
| - name: "OS X Python 3.10" | |
| os: macos-latest | |
| python-version: "3.10" | |
| - name: "Windows Python 3.x" | |
| os: windows-latest | |
| python-version: 3.x | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Ruff Lint | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: astral-sh/ruff-action@v4.0.0 | |
| with: | |
| src: "./getdist" | |
| - name: Ruff Format Check | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: astral-sh/ruff-action@v4.0.0 | |
| with: | |
| src: "./getdist" | |
| args: "format --check" | |
| - name: Install dependencies | |
| run: | | |
| python --version | |
| pip install . | |
| git clone --depth=1 https://github.com/cmbant/getdist_testchains | |
| - name: Install PyMC and ArviZ (Unix only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| pip install pymc arviz | |
| - name: Run tests | |
| run: | | |
| getdist --help | |
| python -m unittest getdist.tests.getdist_test | |
| - name: Run ArviZ wrapper tests (Unix only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| python -m unittest getdist.tests.test_arviz_wrapper | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'cmbant' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -U build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@release/v1 |