|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | | - pull_request: |
6 | | - push: |
7 | | - branches: |
8 | | - - master |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 |
|
12 | | - format: |
13 | | - name: Format code |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - name: Setup Python |
17 | | - uses: actions/setup-python@v4 |
18 | | - with: |
19 | | - python-version: '3.11' |
20 | | - - name: Checkout |
21 | | - uses: actions/checkout@v3 |
22 | | - - name: Install requirements |
23 | | - run: pip install -r requirements-dev.txt |
24 | | - - name: Run isort |
25 | | - run: isort --check --profile=black --diff ./pybind11_stubgen |
26 | | - if: ${{ failure() || success() }} |
27 | | - - name: Run black |
28 | | - run: black --diff ./pybind11_stubgen |
29 | | - if: ${{ failure() || success() }} |
30 | | - - name: Run flake8 |
31 | | - run: | |
32 | | - flake8 \ |
33 | | - --max-line-length=88 \ |
34 | | - --extend-ignore=E203 \ |
35 | | - --extend-exclude=venv/,.pytest_cache/,.ipynb_checkpoints/,tests/,tmp/,build/ |
36 | | - if: ${{ failure() || success() }} |
37 | | - |
38 | | - tests: |
39 | | - name: "🐍 ${{ matrix.python }} • pybind-${{ matrix.pybind11-branch }}" |
40 | | - runs-on: ubuntu-latest |
41 | | - strategy: |
42 | | - fail-fast: false |
43 | | - matrix: |
44 | | - pybind11-branch: [ "master" ] |
45 | | - python: |
46 | | - - "3.11" |
47 | | - - "3.10" |
48 | | - - "3.9" |
49 | | - - "3.8" |
50 | | - - "3.7" |
51 | | - steps: |
52 | | - - uses: actions/checkout@v3 |
53 | | - |
54 | | - - name: Setup Python ${{ matrix.python }} |
55 | | - uses: actions/setup-python@v4 |
56 | | - with: |
57 | | - python-version: ${{ matrix.python }} |
58 | | - |
59 | | - - name: Update CMake |
60 | | - |
61 | | - |
62 | | - - name: Setup annotations on Linux |
63 | | - if: runner.os == 'Linux' |
64 | | - run: python -m pip install pytest-github-actions-annotate-failures |
65 | | - |
66 | | - - name: Install requirements |
67 | | - run: pip install -r "./tests/stubs/python-${{ matrix.python }}/requirements.txt" |
68 | | - |
69 | | - - name: Install pybind11-stubgen |
70 | | - run: pip install . |
71 | | - |
72 | | - - name: Install demo module |
73 | | - shell: bash |
74 | | - run: ./tests/install-demo-module.sh --pybind11-branch "${{ matrix.pybind11-branch }}" |
75 | | - |
76 | | - - name: Check stubs generation |
77 | | - shell: bash |
78 | | - run: ./tests/check-demo-stubs-generation.sh --stubs-sub-dir "stubs/python-${{ matrix.python }}/pybind11-${{ matrix.pybind11-branch }}" |
79 | | - |
80 | | - - name: Archive patch |
81 | | - uses: actions/upload-artifact@v3 |
82 | | - if: failure() |
83 | | - with: |
84 | | - name: "python-${{ matrix.python }}-pybind-${{ matrix.pybind11-branch }}.patch" |
85 | | - path: "./tests/stubs/python-${{ matrix.python }}/pybind11-${{ matrix.pybind11-branch }}.patch" |
86 | | - retention-days: 30 |
87 | | - if-no-files-found: ignore |
| 12 | + format: |
| 13 | + name: Format code |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Setup Python |
| 17 | + uses: actions/setup-python@v4 |
| 18 | + with: |
| 19 | + python-version: '3.11' |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v3 |
| 22 | + - name: Install requirements |
| 23 | + run: pip install -r requirements-dev.txt |
| 24 | + - name: Run isort |
| 25 | + run: isort --check --profile=black --diff ./pybind11_stubgen |
| 26 | + if: ${{ failure() || success() }} |
| 27 | + - name: Run black |
| 28 | + run: black --diff ./pybind11_stubgen |
| 29 | + if: ${{ failure() || success() }} |
| 30 | + - name: Run flake8 |
| 31 | + run: | |
| 32 | + flake8 \ |
| 33 | + --max-line-length=88 \ |
| 34 | + --extend-ignore=E203 \ |
| 35 | + --extend-exclude=venv/,.pytest_cache/,.ipynb_checkpoints/,tests/,tmp/,build/ |
| 36 | + if: ${{ failure() || success() }} |
| 37 | + |
| 38 | + tests: |
| 39 | + name: "Test 🐍 ${{ matrix.python }} • pybind-${{ matrix.pybind11-branch }}" |
| 40 | + runs-on: ubuntu-latest |
| 41 | + strategy: |
| 42 | + fail-fast: false |
| 43 | + matrix: |
| 44 | + pybind11-branch: [ "master" ] |
| 45 | + python: |
| 46 | + - "3.11" |
| 47 | + - "3.10" |
| 48 | + - "3.9" |
| 49 | + - "3.8" |
| 50 | + - "3.7" |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v3 |
| 53 | + |
| 54 | + - name: Setup Python ${{ matrix.python }} |
| 55 | + uses: actions/setup-python@v4 |
| 56 | + with: |
| 57 | + python-version: ${{ matrix.python }} |
| 58 | + |
| 59 | + - name: Update CMake |
| 60 | + |
| 61 | + |
| 62 | + - name: Setup annotations on Linux |
| 63 | + if: runner.os == 'Linux' |
| 64 | + run: python -m pip install pytest-github-actions-annotate-failures |
| 65 | + |
| 66 | + - name: Install requirements |
| 67 | + run: pip install -r "./tests/stubs/python-${{ matrix.python }}/requirements.txt" |
| 68 | + |
| 69 | + - name: Install pybind11-stubgen |
| 70 | + run: pip install . |
| 71 | + |
| 72 | + - name: Install demo module |
| 73 | + shell: bash |
| 74 | + run: ./tests/install-demo-module.sh --pybind11-branch "${{ matrix.pybind11-branch }}" |
| 75 | + |
| 76 | + - name: Check stubs generation |
| 77 | + shell: bash |
| 78 | + run: ./tests/check-demo-stubs-generation.sh --stubs-sub-dir "stubs/python-${{ matrix.python }}/pybind11-${{ matrix.pybind11-branch }}" |
| 79 | + |
| 80 | + - name: Archive patch |
| 81 | + uses: actions/upload-artifact@v3 |
| 82 | + if: failure() |
| 83 | + with: |
| 84 | + name: "python-${{ matrix.python }}-pybind-${{ matrix.pybind11-branch }}.patch" |
| 85 | + path: "./tests/stubs/python-${{ matrix.python }}/pybind11-${{ matrix.pybind11-branch }}.patch" |
| 86 | + retention-days: 30 |
| 87 | + if-no-files-found: ignore |
| 88 | + test-cli-options: |
| 89 | + name: "Runs on 🐍 ${{ matrix.python }} • ${{ matrix.test-package }}" |
| 90 | + runs-on: ubuntu-latest |
| 91 | + strategy: |
| 92 | + fail-fast: false |
| 93 | + matrix: |
| 94 | + test-package: [ "gemmi" ] |
| 95 | + python: |
| 96 | + - "3.11" |
| 97 | + - "3.10" |
| 98 | + - "3.9" |
| 99 | + - "3.8" |
| 100 | + - "3.7" |
| 101 | + steps: |
| 102 | + - uses: actions/checkout@v3 |
| 103 | + |
| 104 | + - name: Setup Python ${{ matrix.python }} |
| 105 | + uses: actions/setup-python@v4 |
| 106 | + with: |
| 107 | + python-version: ${{ matrix.python }} |
| 108 | + |
| 109 | + - name: Setup annotations on Linux |
| 110 | + if: runner.os == 'Linux' |
| 111 | + run: python -m pip install pytest-github-actions-annotate-failures |
| 112 | + |
| 113 | + - name: Install pybind11-stubgen |
| 114 | + run: pip install . |
| 115 | + |
| 116 | + - name: "Install ${{ matrix.test-package }}" |
| 117 | + shell: bash |
| 118 | + run: pip install "${{ matrix.test-package }}" |
| 119 | + |
| 120 | + - name: Generate stubs |
| 121 | + shell: bash |
| 122 | + run: | |
| 123 | + pybind11-stubgen "${{ matrix.test-package }}" -o flavour-1 --numpy-array-wrap-with-annotated |
| 124 | + pybind11-stubgen "${{ matrix.test-package }}" -o flavour-2 --numpy-array-remove-parameters |
| 125 | + pybind11-stubgen "${{ matrix.test-package }}" -o flavour-3 --print-invalid-expressions-as-is |
| 126 | + pybind11-stubgen "${{ matrix.test-package }}" --dry-run |
0 commit comments