Fix uniqueness condition in one of the tests causing rare failures #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test & Publish | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10", "pypy-3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Update pip | |
| run: python -m pip install --upgrade pip | |
| - name: Build and install python-doubleratchet | |
| run: pip install . | |
| - name: Install test dependencies | |
| run: pip install .[test,lint] | |
| - name: Type-check using mypy | |
| run: mypy doubleratchet/ examples/ tests/ | |
| - name: Lint using pylint | |
| run: pylint doubleratchet/ examples/ tests/ | |
| - name: Format-check using Flake8 | |
| run: flake8 doubleratchet/ examples/ tests/ | |
| - name: Test using pytest | |
| run: pytest | |
| build: | |
| name: Build source distribution and wheel | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install build | |
| run: pip install build | |
| - name: Build source distribution and wheel | |
| run: python -m build --sdist --wheel | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: | | |
| dist/*.tar.gz | |
| dist/*.whl | |
| publish: | |
| needs: [test, build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |