|
| 1 | +name: shared_build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - v* |
| 7 | + branches: |
| 8 | + - master |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - master |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: build_shared-${{ github.head_ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +env: |
| 18 | + COINCURVE_UPSTREAM_REF: 1ad5185cd42c0636104129fcc9f6a4bf9c67cc40 |
| 19 | + COINCURVE_IGNORE_SYSTEM_LIB: '1' |
| 20 | + # Only 'SHARED' is recognized, any other string means 'not SHARED' |
| 21 | + COINCURVE_SECP256K1_BUILD: 'SHARED' |
| 22 | + CIBW_ENVIRONMENT_PASS_LINUX: > |
| 23 | + COINCURVE_UPSTREAM_REF |
| 24 | + COINCURVE_IGNORE_SYSTEM_LIB |
| 25 | + COINCURVE_SECP256K1_BUILD |
| 26 | + CIBW_PROJECT_REQUIRES_PYTHON: '>=3.8' |
| 27 | + CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh |
| 28 | + CIBW_TEST_REQUIRES: pytest pytest-benchmark |
| 29 | + CIBW_TEST_COMMAND: > |
| 30 | + python -c |
| 31 | + "from coincurve import PrivateKey; |
| 32 | + a=PrivateKey(); |
| 33 | + b=PrivateKey(); |
| 34 | + assert a.ecdh(b.public_key.format())==b.ecdh(a.public_key.format()) |
| 35 | + " && |
| 36 | + python -m pytest {project} |
| 37 | + CIBW_TEST_SKIP: "*-macosx_arm64" |
| 38 | + CIBW_SKIP: > |
| 39 | + pp* |
| 40 | +
|
| 41 | +jobs: |
| 42 | + test: |
| 43 | + name: Test latest Python |
| 44 | + runs-on: ubuntu-latest |
| 45 | + |
| 46 | + env: |
| 47 | + PYTHON_VERSION: '3.12' |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Set up Python ${{ env.PYTHON_VERSION }} |
| 53 | + uses: actions/setup-python@v5 |
| 54 | + with: |
| 55 | + python-version: ${{ env.PYTHON_VERSION }} |
| 56 | + |
| 57 | + - name: Upgrade Python packaging tools |
| 58 | + run: pip install --upgrade pip setuptools wheel |
| 59 | + |
| 60 | + - name: Show runner information |
| 61 | + run: | |
| 62 | + python --version |
| 63 | + pip --version |
| 64 | +
|
| 65 | + - name: Install dependencies |
| 66 | + run: ./.github/scripts/install-test-deps.sh |
| 67 | + |
| 68 | + - name: Check style and typing |
| 69 | + run: tox -e lint,typing |
| 70 | + |
| 71 | + - name: Run tests |
| 72 | + run: tox -e ${PYTHON_VERSION} |
| 73 | + |
| 74 | + - name: Run benchmarks |
| 75 | + run: tox -e bench |
| 76 | + |
| 77 | + - name: Upload coverage |
| 78 | + run: codecov -X gcov |
| 79 | + |
| 80 | + linux-wheels-standard: |
| 81 | + name: Build Linux wheels |
| 82 | + needs: |
| 83 | + - test |
| 84 | + runs-on: ubuntu-latest |
| 85 | + |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Build wheels |
| 90 | + |
| 91 | + |
| 92 | + macos-wheels-x86_64: |
| 93 | + name: Build macOS wheels |
| 94 | + needs: |
| 95 | + - test |
| 96 | + runs-on: macos-latest |
| 97 | + |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v4 |
| 100 | + |
| 101 | + - name: Build wheels |
| 102 | + |
| 103 | + env: |
| 104 | + CIBW_ARCHS_MACOS: x86_64 |
| 105 | + |
| 106 | + macos-wheels-arm: |
| 107 | + name: Build macOS wheels for ARM (Native) |
| 108 | + needs: |
| 109 | + - test |
| 110 | + runs-on: macos-14 |
| 111 | + |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@v4 |
| 114 | + |
| 115 | + - name: Build wheels |
| 116 | + |
| 117 | + |
| 118 | + windows-wheels-x86_64: |
| 119 | + name: Build Windows wheels AMD64 |
| 120 | + needs: |
| 121 | + - test |
| 122 | + runs-on: windows-latest |
| 123 | + |
| 124 | + steps: |
| 125 | + - uses: actions/checkout@v4 |
| 126 | + |
| 127 | + - uses: actions/setup-python@v5 |
| 128 | + with: |
| 129 | + python-version: '3.12' |
| 130 | + |
| 131 | + - name: Build wheels |
| 132 | + |
| 133 | + env: |
| 134 | + CIBW_ARCHS_WINDOWS: 'AMD64' |
| 135 | + CIBW_BEFORE_ALL: choco install -y --no-progress --no-color cmake>=3.28 |
| 136 | + |
| 137 | + windows-wheels-arm: |
| 138 | + name: Build Windows wheels for ARM64 |
| 139 | + needs: |
| 140 | + - test |
| 141 | + runs-on: windows-latest |
| 142 | + |
| 143 | + steps: |
| 144 | + - uses: actions/checkout@v4 |
| 145 | + |
| 146 | + - name: Build wheels |
| 147 | + |
| 148 | + env: |
| 149 | + COINCURVE_CROSS_HOST: 'arm64' |
| 150 | + CIBW_ARCHS_WINDOWS: 'ARM64' |
| 151 | + CIBW_BEFORE_ALL: choco install -y --no-progress --no-color cmake>=3.28 |
0 commit comments