Wrap sends in a separate nursery #100
This file contains 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: build | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/[email protected] | |
- name: Cache poetry virtualenv | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: ~/.virtualenvs | |
key: poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Set poetry config | |
run: | | |
poetry config virtualenvs.in-project false | |
poetry config virtualenvs.path ~/.virtualenvs | |
- name: Install dependencies | |
run: poetry install | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Test with pytest | |
run: poetry run pytest | |
publish: | |
name: Publish | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.12'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/[email protected] | |
- name: Cache poetry virtualenv | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.virtualenvs | |
key: poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Set poetry config | |
run: | | |
poetry config virtualenvs.in-project false | |
poetry config virtualenvs.path ~/.virtualenvs | |
- name: Install dependencies | |
run: poetry install | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Publish to pypi | |
run: | | |
poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" | |
poetry publish --build |