|
| 1 | +# This file is autogenerated by maturin v1.3.0 |
| 2 | +# To update, run |
| 3 | +# |
| 4 | +# maturin generate-ci --pytest --zig -m pyargus/Cargo.toml github -o .github/workflows/release.yaml |
| 5 | +# |
| 6 | +name: CI |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - dev |
| 12 | + - main |
| 13 | + tags: |
| 14 | + - '*' |
| 15 | + pull_request: |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + linux: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + target: [x86_64, aarch64] |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v3 |
| 29 | + - uses: actions/setup-python@v4 |
| 30 | + with: |
| 31 | + python-version: '3.10' |
| 32 | + - name: Build wheels |
| 33 | + uses: PyO3/maturin-action@v1 |
| 34 | + with: |
| 35 | + target: ${{ matrix.target }} |
| 36 | + args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml --zig |
| 37 | + sccache: 'true' |
| 38 | + manylinux: auto |
| 39 | + - name: Upload wheels |
| 40 | + uses: actions/upload-artifact@v3 |
| 41 | + with: |
| 42 | + name: wheels |
| 43 | + path: dist |
| 44 | + - name: pytest |
| 45 | + if: ${{ startsWith(matrix.target, 'x86_64') }} |
| 46 | + shell: bash |
| 47 | + run: | |
| 48 | + set -e |
| 49 | + pip install pyargus --find-links dist --force-reinstall |
| 50 | + pip install pytest |
| 51 | + cd pyargus && pytest |
| 52 | + - name: pytest |
| 53 | + if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' }} |
| 54 | + |
| 55 | + with: |
| 56 | + arch: ${{ matrix.target }} |
| 57 | + distro: ubuntu22.04 |
| 58 | + githubToken: ${{ github.token }} |
| 59 | + install: | |
| 60 | + apt-get update |
| 61 | + apt-get install -y --no-install-recommends python3 python3-pip |
| 62 | + pip3 install -U pip pytest |
| 63 | + run: | |
| 64 | + set -e |
| 65 | + pip3 install pyargus --find-links dist --force-reinstall |
| 66 | + cd pyargus && pytest |
| 67 | +
|
| 68 | + windows: |
| 69 | + runs-on: windows-latest |
| 70 | + strategy: |
| 71 | + matrix: |
| 72 | + target: [x64, x86] |
| 73 | + steps: |
| 74 | + - uses: actions/checkout@v3 |
| 75 | + - uses: actions/setup-python@v4 |
| 76 | + with: |
| 77 | + python-version: '3.10' |
| 78 | + architecture: ${{ matrix.target }} |
| 79 | + - name: Build wheels |
| 80 | + uses: PyO3/maturin-action@v1 |
| 81 | + with: |
| 82 | + target: ${{ matrix.target }} |
| 83 | + args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml |
| 84 | + sccache: 'true' |
| 85 | + - name: Upload wheels |
| 86 | + uses: actions/upload-artifact@v3 |
| 87 | + with: |
| 88 | + name: wheels |
| 89 | + path: dist |
| 90 | + - name: pytest |
| 91 | + if: ${{ !startsWith(matrix.target, 'aarch64') }} |
| 92 | + shell: bash |
| 93 | + run: | |
| 94 | + set -e |
| 95 | + pip install pyargus --find-links dist --force-reinstall |
| 96 | + pip install pytest |
| 97 | + cd pyargus && pytest |
| 98 | +
|
| 99 | + macos: |
| 100 | + runs-on: macos-latest |
| 101 | + strategy: |
| 102 | + matrix: |
| 103 | + target: [x86_64, aarch64] |
| 104 | + steps: |
| 105 | + - uses: actions/checkout@v3 |
| 106 | + - uses: actions/setup-python@v4 |
| 107 | + with: |
| 108 | + python-version: '3.10' |
| 109 | + - name: Build wheels |
| 110 | + uses: PyO3/maturin-action@v1 |
| 111 | + with: |
| 112 | + target: ${{ matrix.target }} |
| 113 | + args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml |
| 114 | + sccache: 'true' |
| 115 | + - name: Upload wheels |
| 116 | + uses: actions/upload-artifact@v3 |
| 117 | + with: |
| 118 | + name: wheels |
| 119 | + path: dist |
| 120 | + - name: pytest |
| 121 | + if: ${{ !startsWith(matrix.target, 'aarch64') }} |
| 122 | + shell: bash |
| 123 | + run: | |
| 124 | + set -e |
| 125 | + pip install pyargus --find-links dist --force-reinstall |
| 126 | + pip install pytest |
| 127 | + cd pyargus && pytest |
| 128 | +
|
| 129 | + sdist: |
| 130 | + runs-on: ubuntu-latest |
| 131 | + steps: |
| 132 | + - uses: actions/checkout@v3 |
| 133 | + - name: Build sdist |
| 134 | + uses: PyO3/maturin-action@v1 |
| 135 | + with: |
| 136 | + command: sdist |
| 137 | + args: --out dist --manifest-path pyargus/Cargo.toml |
| 138 | + - name: Upload sdist |
| 139 | + uses: actions/upload-artifact@v3 |
| 140 | + with: |
| 141 | + name: wheels |
| 142 | + path: dist |
| 143 | + |
| 144 | + release: |
| 145 | + name: Release |
| 146 | + runs-on: ubuntu-latest |
| 147 | + if: "startsWith(github.ref, 'refs/tags/')" |
| 148 | + needs: [linux, windows, macos, sdist] |
| 149 | + steps: |
| 150 | + - uses: actions/download-artifact@v3 |
| 151 | + with: |
| 152 | + name: wheels |
| 153 | + - uses: softprops/action-gh-release@v1 |
| 154 | + with: |
| 155 | + files: 'dist/*' |
| 156 | + |
| 157 | + # - name: Publish to PyPI |
| 158 | + # uses: PyO3/maturin-action@v1 |
| 159 | + # env: |
| 160 | + # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 161 | + # with: |
| 162 | + # command: upload |
| 163 | + # args: --non-interactive --skip-existing * |
0 commit comments