|
1 |
| -on: create |
| 1 | +on: |
| 2 | + push: |
| 3 | + pull_request: |
| 4 | + create: |
| 5 | + |
2 | 6 | name: Continuous Delivery
|
3 | 7 | jobs:
|
4 |
| - PrepareRelease: |
5 |
| - name: prepare-release |
6 |
| - if: startsWith(github.ref, 'refs/tags/') |
| 8 | + build_wheels: |
| 9 | + name: cibuildwheel on ${{ matrix.os }} ${{ matrix.architecture }} |
| 10 | + if: (github.event_name == 'create' && github.event.ref_type == 'tag') || contains(github.event.head_commit.message, '[build wheel]') || contains(github.event.pull_request.title, '[build wheel]') |
| 11 | + env: |
| 12 | + CIBW_BEFORE_ALL_LINUX: 'yum install -y java-11-openjdk-devel' |
| 13 | + CIBW_ARCHS_MACOS: "x86_64 universal2" |
| 14 | + CIBW_REPAIR_WHEEL_COMMAND_MACOS: '' |
7 | 15 | strategy:
|
8 | 16 | matrix:
|
9 |
| - python: |
10 |
| - - '3.6' |
11 |
| - - '3.7' |
12 |
| - - '3.8' |
13 |
| - - '3.9' |
14 |
| - - '3.10' |
15 |
| - java: |
16 |
| - - '12' |
17 |
| - os: |
18 |
| - - 'windows-latest' |
19 |
| - - 'macOs-latest' |
20 |
| - architecture: |
21 |
| - - 'x64' |
22 |
| - - 'x86' |
23 |
| - |
24 |
| - # exclude problematic combinations |
25 |
| - exclude: |
26 |
| - - os: ubuntu-latest |
27 |
| - architecture: 'x86' |
28 |
| - - os: macOs-latest |
29 |
| - architecture: 'x86' |
30 |
| - |
| 17 | + os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] |
| 18 | + architecture: ['x64'] |
| 19 | + include: |
| 20 | + - os: windows-latest |
| 21 | + architecture: 'x86' |
| 22 | + cibw_skip: '*_amd64' |
| 23 | + - os: windows-latest |
| 24 | + architecture: 'x64' |
| 25 | + cibw_skip: '*-win32' |
| 26 | + - os: ubuntu-latest |
| 27 | + architecture: 'x64' |
| 28 | + cibw_skip: '*-manylinux_i686' |
31 | 29 | runs-on: ${{ matrix.os }}
|
32 | 30 | steps:
|
33 |
| - - uses: actions/checkout@master |
34 |
| - - name: Setup python |
35 |
| - uses: actions/setup-python@v2 |
36 |
| - with: |
37 |
| - python-version: ${{ matrix.python }} |
38 |
| - architecture: ${{ matrix.architecture }} |
| 31 | + - name: Checkout pyjnius |
| 32 | + uses: actions/checkout@v3 |
39 | 33 |
|
40 |
| - - name: Setup java |
41 |
| - uses: actions/setup-java@v1 |
42 |
| - with: |
43 |
| - java-version: ${{ matrix.java }} |
44 |
| - architecture: ${{ matrix.architecture }} |
45 |
| - |
46 |
| - - name: build sdist |
47 |
| - if: matrix.os == 'windows-latest' && matrix.python == '3.8' && matrix.architecture == 'x64' |
48 |
| - run: | |
49 |
| - pip install -U setuptools |
50 |
| - python setup.py sdist |
51 |
| -
|
52 |
| - - name: build-wheel-windows |
53 |
| - if: matrix.os == 'windows-latest' |
54 |
| - run: | |
55 |
| - "%VS140COMNTOOLS%../../VC/vcvarsall.bat" |
56 |
| - echo "$INCLUDE" |
57 |
| - set INCLUDE "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt" |
58 |
| - pip install --timeout=120 -U setuptools wheel cython |
59 |
| - python setup.py bdist_wheel |
60 |
| -
|
61 |
| - - name: build wheel |
62 |
| - if: matrix.os != 'windows-latest' |
63 |
| - run: | |
64 |
| - pip install -U --timeout=120 -U setuptools wheel cython |
65 |
| - python setup.py bdist_wheel |
66 |
| -
|
67 |
| - - name: upload wheel |
68 |
| - uses: actions/upload-artifact@master |
69 |
| - with: |
70 |
| - name: dist |
71 |
| - path: dist |
| 34 | + - name: Setup Python |
| 35 | + uses: actions/setup-python@v3 |
| 36 | + |
| 37 | + - name: Install cibuildwheel |
| 38 | + run: python -m pip install cibuildwheel==2.6.0 |
| 39 | + |
| 40 | + - name: Setup java |
| 41 | + # There's no need to setup java on ubuntu-latest, as build is done into a manylinux |
| 42 | + # containerized environment. (CIBW_BEFORE_ALL_LINUX) takes care of it. |
| 43 | + if: ${{ matrix.os != 'ubuntu-latest' }} |
| 44 | + uses: actions/setup-java@v3 |
| 45 | + with: |
| 46 | + java-version: '17' |
| 47 | + distribution: 'temurin' |
| 48 | + architecture: ${{ matrix.architecture }} |
72 | 49 |
|
73 |
| - PrepareManylinux: |
74 |
| - name: prepare-manylinux |
75 |
| - if: startsWith(github.ref, 'refs/tags/') |
| 50 | + - name: Build wheels |
| 51 | + env: |
| 52 | + CIBW_SKIP: '*musllinux* ${{ matrix.cibw_skip }}' |
| 53 | + run: python -m cibuildwheel --output-dir dist |
| 54 | + |
| 55 | + - name: upload wheels |
| 56 | + uses: actions/upload-artifact@v2 |
| 57 | + with: |
| 58 | + name: dist |
| 59 | + path: dist |
| 60 | + |
| 61 | + build_sdist: |
| 62 | + name: Build sdist |
| 63 | + if: (github.event_name == 'create' && github.event.ref_type == 'tag') || contains(github.event.head_commit.message, '[build sdist]') || contains(github.event.pull_request.title, '[build sdist]') |
76 | 64 | runs-on: 'ubuntu-latest'
|
77 | 65 | steps:
|
78 |
| - - uses: actions/checkout@master |
| 66 | + - name: Checkout pyjnius |
| 67 | + uses: actions/checkout@v3 |
79 | 68 |
|
80 |
| - - uses: docker://quay.io/pypa/manylinux2010_x86_64 |
81 |
| - with: |
82 |
| - entrypoint: .github/actions/scripts/manylinux_entrypoint.sh |
| 69 | + - name: Setup Python |
| 70 | + uses: actions/setup-python@v3 |
83 | 71 |
|
84 |
| - - name: upload wheel |
85 |
| - uses: actions/upload-artifact@master |
86 |
| - with: |
87 |
| - name: dist |
88 |
| - path: dist |
| 72 | + - name: Build sdist |
| 73 | + run: | |
| 74 | + pip install -U setuptools |
| 75 | + python setup.py sdist |
| 76 | +
|
| 77 | + - name: upload sdist |
| 78 | + uses: actions/upload-artifact@v2 |
| 79 | + with: |
| 80 | + name: dist |
| 81 | + path: dist |
| 82 | + |
| 83 | + test_wheels: |
| 84 | + name: Test wheel on ${{ matrix.os }} (${{ matrix.architecture }}) Python ${{ matrix.python }} |
| 85 | + if: (github.event_name == 'create' && github.event.ref_type == 'tag') || contains(github.event.head_commit.message, '[build wheel]') || contains(github.event.pull_request.title, '[build wheel]') |
| 86 | + needs: |
| 87 | + - build_wheels |
| 88 | + continue-on-error: true |
| 89 | + strategy: |
| 90 | + matrix: |
| 91 | + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
| 92 | + python: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9'] |
| 93 | + include: |
| 94 | + # We may would like to introduce tests also on windows-latest on x86 (win32 wheels)? |
| 95 | + - os: windows-latest |
| 96 | + architecture: 'x64' |
| 97 | + - os: macos-latest |
| 98 | + architecture: 'x64' |
| 99 | + - os: ubuntu-latest |
| 100 | + architecture: 'x64' |
| 101 | + - os: apple-silicon-m1 |
| 102 | + architecture: 'aarch64' |
| 103 | + python: '3.8.13' |
| 104 | + - os: apple-silicon-m1 |
| 105 | + architecture: 'aarch64' |
| 106 | + python: '3.9.11' |
| 107 | + - os: apple-silicon-m1 |
| 108 | + architecture: 'aarch64' |
| 109 | + python: '3.10.3' |
| 110 | + runs-on: ${{ matrix.os }} |
| 111 | + steps: |
| 112 | + - name: Checkout pyjnius |
| 113 | + uses: actions/checkout@v3 |
| 114 | + |
| 115 | + - uses: actions/download-artifact@v2 |
| 116 | + with: |
| 117 | + name: dist |
| 118 | + path: dist |
| 119 | + |
| 120 | + - name: Setup Python |
| 121 | + # Needs to be skipped on our self-hosted runners tagged as 'apple-silicon-m1' |
| 122 | + if: ${{ matrix.os != 'apple-silicon-m1' }} |
| 123 | + uses: actions/setup-python@v3 |
| 124 | + with: |
| 125 | + python-version: ${{ matrix.python }} |
| 126 | + |
| 127 | + - name: Setup java |
| 128 | + uses: actions/setup-java@v3 |
| 129 | + with: |
| 130 | + java-version: '17' |
| 131 | + distribution: 'temurin' |
| 132 | + architecture: ${{ matrix.architecture }} |
| 133 | + |
| 134 | + - name: Setup ant on macOS |
| 135 | + if: (matrix.os == 'macos-latest') || (matrix.os == 'apple-silicon-m1') |
| 136 | + run: | |
| 137 | + source .ci/osx_ci.sh |
| 138 | + arm64_set_path_and_python_version ${{ matrix.python }} |
| 139 | + brew install ant |
| 140 | +
|
| 141 | + - name: Build test-classes via ant (macOS x64, macOS Apple Silicon) |
| 142 | + if: (matrix.os == 'macos-latest') || (matrix.os == 'apple-silicon-m1') |
| 143 | + run: | |
| 144 | + source .ci/osx_ci.sh |
| 145 | + arm64_set_path_and_python_version ${{ matrix.python }} |
| 146 | + ant all |
| 147 | +
|
| 148 | + - name: Build test-classes via ant (Linux, Windows) |
| 149 | + if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'windows-latest') |
| 150 | + run: ant all |
| 151 | + |
| 152 | + - name: Install pyjnius wheel + test prerequisites (Windows, Linux, macOS x64) |
| 153 | + if: matrix.os != 'apple-silicon-m1' |
| 154 | + run: python -m pip install --find-links=dist pyjnius[dev,ci] |
| 155 | + |
| 156 | + - name: Install pyjnius wheel + test prerequisites (Apple Silicon M1) |
| 157 | + if: matrix.os == 'apple-silicon-m1' |
| 158 | + run: | |
| 159 | + source .ci/osx_ci.sh |
| 160 | + arm64_set_path_and_python_version ${{ matrix.python }} |
| 161 | + python -m pip install --find-links=dist pyjnius[dev,ci] |
| 162 | +
|
| 163 | + - name: Test wheel (Linux, macOS x64) |
| 164 | + if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') |
| 165 | + run: | |
| 166 | + cd tests |
| 167 | + CLASSPATH=../build/test-classes:../build/classes python -m pytest -v |
| 168 | +
|
| 169 | + - name: Test wheel (macOS Apple Silicon) |
| 170 | + if: matrix.os == 'apple-silicon-m1' |
| 171 | + run: | |
| 172 | + source .ci/osx_ci.sh |
| 173 | + arm64_set_path_and_python_version ${{ matrix.python }} |
| 174 | + cd tests |
| 175 | + CLASSPATH=../build/test-classes:../build/classes python -m pytest -v |
| 176 | +
|
| 177 | + - name: Test wheel ( Windows + Python == 3.7.x ) |
| 178 | + # On Python < 3.8.x, we can't use `os.add_dll_directory`, so the jre should be in PATH. |
| 179 | + if: (matrix.os == 'windows-latest') && contains(matrix.python, '3.7') |
| 180 | + run: | |
| 181 | + cd tests |
| 182 | + $env:PATH +=";$env:JAVA_HOME\jre\bin\server\;$env:JAVA_HOME\jre\bin\client\;$env:JAVA_HOME\bin\server\" |
| 183 | + $env:CLASSPATH ="../build/test-classes;../build/classes" |
| 184 | + python -m pytest -v |
| 185 | +
|
| 186 | + - name: Test wheel (Windows + Python != 3.7.x ) |
| 187 | + if: (matrix.os == 'windows-latest') && !contains(matrix.python, '3.7') |
| 188 | + run: | |
| 189 | + cd tests |
| 190 | + $env:CLASSPATH ="../build/test-classes;../build/classes" |
| 191 | + python -m pytest -v |
| 192 | + |
89 | 193 |
|
90 |
| - Release: |
| 194 | + release: |
| 195 | + if: (github.event_name == 'create' && github.event.ref_type == 'tag') |
91 | 196 | name: release
|
92 | 197 | needs:
|
93 |
| - - PrepareRelease |
94 |
| - - PrepareManylinux |
| 198 | + - build_wheels |
| 199 | + - build_sdist |
| 200 | + - test_wheels |
95 | 201 | runs-on: 'ubuntu-latest'
|
96 | 202 | steps:
|
97 |
| - - uses: actions/download-artifact@master |
| 203 | + - uses: actions/download-artifact@v2 |
98 | 204 | with:
|
99 | 205 | name: dist
|
100 | 206 | path: dist
|
|
0 commit comments