diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b2d65a8..8743b31 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,8 +18,47 @@ permissions: contents: read jobs: + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - run: pip install pre-commit + name: Install pre-commit + - run: pre-commit run --all + name: Run pre-commit checks + + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10'] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + args: --interpreter ${{ matrix.python_version }} + sccache: 'true' + manylinux: auto + command: develop + - run: pip install pytest + name: Install pytest + - run: pytest tests/ + name: Run tests + linux: runs-on: ubuntu-latest + needs: + - test + - lint strategy: matrix: target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] @@ -43,21 +82,25 @@ jobs: path: dist windows: + needs: + - test + - lint runs-on: windows-latest strategy: matrix: target: [x64, x86] + python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10'] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: ${{ matrix.python_version }} architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --find-interpreter + args: --release --out dist --interpreter ${{ matrix.python_version }} sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v3 @@ -66,20 +109,24 @@ jobs: path: dist macos: + needs: + - test + - lint runs-on: macos-latest strategy: matrix: target: [x86_64, aarch64] + python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10'] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: ${{ matrix.python_version }} - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --find-interpreter + args: --release --out dist --interpreter ${{ matrix.python_version }} sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v3 @@ -88,6 +135,9 @@ jobs: path: dist sdist: + needs: + - test + - lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v3