File: ci-check.yml

package info (click to toggle)
mpi4py 4.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,560 kB
  • sloc: python: 35,306; ansic: 16,482; sh: 837; makefile: 618; cpp: 193; f90: 178
file content (232 lines) | stat: -rw-r--r-- 5,526 bytes parent folder | download | duplicates (2)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: ci-check

on:  # yamllint disable-line rule:truthy
  schedule:
    - cron: '0 3 * * 0'
  workflow_call:
    inputs:
      py:
        description: 'Python version'
        required: false
        default: 3
        type: string
  workflow_dispatch:
    inputs:
      py:
        description: 'Python version'
        required: true
        default: 3
        type: string

permissions:
  contents: read

jobs:

  conf:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest

    steps:

    - uses: step-security/harden-runner@v2
      with:
        egress-policy: audit

    - name: Checkout
      uses: actions/checkout@v5

    - name: Setup Python (${{ github.event.inputs.py || 3 }})
      uses: actions/setup-python@v6
      with:
        python-version: ${{ github.event.inputs.py || 3 }}
        check-latest: true
        cache: pip
        cache-dependency-path: |
          conf/requirements-build-cython.txt

    - name: Upgrade pip
      run:  python -m pip install -U pip setuptools

    - name: Install Python packages (build)
      run:  python -m pip install -U -r conf/requirements-build-cython.txt

    - name: Build package
      run:  python setup.py build
      env:
        MPICFG: nompi
        CFLAGS: -O0

    - name: Check build configuration
      run:  |
        # check nompi pympiconf.h
        cp "src/lib-mpi/pympiconf.h" "conf/nompi/pympiconf.h"
        git diff --exit-code

    - name: Check code generation
      run:  |
        python conf/mpiapigen.py
        git diff --exit-code

  docs:
    runs-on: ubuntu-latest

    steps:

    - uses: step-security/harden-runner@v2
      with:
        egress-policy: audit

    - name: Checkout
      uses: actions/checkout@v5

    - name: Setup Python (${{ github.event.inputs.py || 3 }})
      uses: actions/setup-python@v6
      with:
        python-version: ${{ github.event.inputs.py || 3 }}
        cache: pip
        cache-dependency-path: |
          conf/requirements-build-cython.txt
          conf/requirements-build-docs.txt

    - name: Upgrade pip
      run:  python -m pip install -U pip

    - name: Install package for documenting
      run:  python -m pip install .
      env:
        MPICFG: nompi-fast
        CFLAGS: -O0

    - name: Install Python packages (docs)
      run:  python -m pip install -U -r conf/requirements-docs.txt

    - name: sphinx-build coverage
      run:  sphinx-build -M coverage docs/source build -q -E -W -jauto

    - name: check coverage
      run:  |
        coverage=build/coverage/python.txt
        pattern='(classes|functions|methods):'
        if grep -qE $pattern $coverage; then
            cat $coverage; exit 1;
        fi

  lint:
    runs-on: ubuntu-latest

    steps:

    - uses: step-security/harden-runner@v2
      with:
        egress-policy: audit

    - name: Checkout
      uses: actions/checkout@v5

    - name: Setup Python (${{ github.event.inputs.py || 3 }})
      uses: actions/setup-python@v6
      with:
        python-version: ${{ github.event.inputs.py || 3 }}
        cache: pip
        cache-dependency-path: |
          conf/requirements-build-cython.txt
          conf/requirements-build-lint.txt

    - name: Upgrade pip
      run:  python -m pip install -U pip

    - name: Install package for linting
      run:  python -m pip install .
      env:
        MPICFG: nompi-fast
        CFLAGS: -O0

    - name: Install Python packages (lint)
      run:  python -m pip install -U -r conf/requirements-lint.txt

    - name: ruff check
      run:  ruff check

    - name: ruff format
      run:  ruff format --diff

    - name: flake8
      run:  flake8

    - name: pylint
      run:  pylint mpi4py

    - name: codespell
      run:  codespell

    - name: cython
      run:  conf/cythonize.sh -Wextra -Werror

    - name: cython-lint
      run:  cython-lint .

    - name: yamllint
      run:  yamllint .

    - name: shellcheck
      run:  conf/shellcheck.sh

  type:
    runs-on: ubuntu-latest

    steps:

    - uses: step-security/harden-runner@v2
      with:
        egress-policy: audit

    - name: Checkout
      uses: actions/checkout@v5

    - name: Setup Python (${{ github.event.inputs.py || 3 }})
      uses: actions/setup-python@v6
      with:
        python-version: ${{ github.event.inputs.py || 3 }}
        cache: pip
        cache-dependency-path: |
          conf/requirements-build-cython.txt
          conf/requirements-build-type.txt

    - name: Upgrade pip
      run:  python -m pip install -U pip

    - name: Install package for typing
      run:  python -m pip install .
      env:
        MPICFG: nompi-fast
        CFLAGS: -O0

    - name: Check stub generation
      run:  |
        python conf/mpistubgen.py
        git diff --exit-code

    - name: Install Python packages (type)
      run:  python -m pip install -U -r conf/requirements-type.txt

    - name: mypy (typecheck)
      run:  |
        mypy --python-version 3.14 -p mpi4py
        mypy --python-version 3.13 -p mpi4py
        mypy --python-version 3.12 -p mpi4py
        mypy --python-version 3.11 -p mpi4py
        mypy --python-version 3.10 -p mpi4py
        mypy --python-version 3.9  -p mpi4py

    - name: mypy (stubtest)
      run:  stubtest --ignore-disjoint-bases mpi4py
              ${{ github.event.inputs.py == '3.8' && '$(
              echo mpi4py.*.Executor.submit > allowlist &&
              echo --allowlist=allowlist )' || '' }}