-
Notifications
You must be signed in to change notification settings - Fork 62
95 lines (79 loc) · 2.3 KB
/
Copy pathtests.yml
File metadata and controls
95 lines (79 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
with:
src: "./getdist"
- name: Ruff Format Check
if: matrix.os == 'ubuntu-latest'
uses: astral-sh/ruff-action@v4
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