vscode tidy #130
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.x" | |
| os: ubuntu-latest | |
| python-version: 3.x | |
| - name: "OS X Python 3.10" | |
| os: macos-latest | |
| python-version: "3.10" | |
| - name: "Windows Python 3.11" | |
| os: windows-latest | |
| python-version: 3.11 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Ruff Lint | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: astral-sh/ruff-action@v1 | |
| with: | |
| src: "./getdist" | |
| - name: Ruff Format Check | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: astral-sh/ruff-action@v3 | |
| 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: Run tests | |
| run: | | |
| getdist --help | |
| python -m unittest getdist.tests.getdist_test | |
| 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@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| - 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 |