Skip to content

action

action #1

Workflow file for this run

name: tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.12", "3.13"]
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: Install dependencies
run: |
python --version
pip install . PyYAML flake8
git clone --depth=1 https://github.com/cmbant/getdist_testchains
- name: Run flake8
run: |
flake8 getdist --select=E713,E704,E703,E714,E10,E11,E20,E22,E23,E25,E27,E301,E302,E304,E9,F405,F406,F5,F6,F7,F8,W1,W2,W3,W6 --show-source --statistics
- 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/')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U build twine
- name: Build package
run: python -m build --sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1