-
Notifications
You must be signed in to change notification settings - Fork 11
77 lines (74 loc) · 2.48 KB
/
main.yaml
File metadata and controls
77 lines (74 loc) · 2.48 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
# main test workflow; ported from .travis.yaml
name: main
on:
push:
branches: [ '*', $default-branch ]
tags: 'v*'
pull_request:
branches: [ $default-branch ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: ['3.10', '3.13']
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install build deps
run: |
sudo apt-get update
sudo apt-get -y install openmpi-bin libopenmpi-dev
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
python -m pip install setuptools wheel nose mpi4py numpy cython build runtests
python -m build
- name: Install
run: |
python -m pip install `ls dist/pfft_python*.whl`
- name: Unit tests
run: |
python ./runtests.py --mpirun="mpirun -np 4"
- name: Roundtrips
run: |
mpirun -n 1 python $PWD/scripts/pfft-roundtrip-matrix.py -v -diag -Nproc 1 1 -Nmesh 13 15 16
mpirun -n 2 python $PWD/scripts/pfft-roundtrip-matrix.py -v -diag -Nproc 2 1 -Nproc 1 2 -Nmesh 13 15 16
#Not enough slots o github for this test.
# mpirun -n 4 python $PWD/scripts/pfft-roundtrip-matrix.py -v -diag -Nproc 2 2 -Nmesh 13 15 16
# mpirun -n 4 python $PWD/scripts/pfft-roundtrip-matrix.py -v -diag -Nproc 2 2 -Nmesh 13 15
- name: Version
run: |
bash check_tag.sh pfft/version.py
- name: Store the distribution packages
if: matrix.python-version == '3.10' #Only do this once!
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/pfft_python*.tar.gz
#From https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pfft-python
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download the source dist
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1