[pre-commit.ci] pre-commit autoupdate #41
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
on: | |
pull_request: | |
branches: | |
- "main" | |
- "develop" | |
push: | |
branches: | |
- "develop" | |
tags: | |
- "v*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
python_version: ["3.7", "3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- run: pip install --upgrade pip poetry | |
- uses: actions/checkout@v2 | |
- run: poetry install | |
- run: poetry run pytest --cov=fastapi_firebase | |
- run: poetry run coverage lcov | |
- name: Upload coverage data to coveralls.io | |
if: startsWith(github.ref, 'refs/heads/') | |
run: | | |
pip install coveralls | |
coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: python${{ matrix.python_version }} | |
COVERALLS_PARALLEL: true | |
coveralls: | |
name: Indicate completion to coveralls.io | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/heads/') | |
container: | |
image: python:3-slim | |
steps: | |
- name: Finished | |
run: | | |
pip3 install --upgrade coveralls | |
coveralls --service=github --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish_github: | |
name: Publish to github | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- uses: actions/checkout@v2 | |
- run: pip install --upgrade pip poetry | |
name: Install dependencies | |
- run: poetry install | |
- run: poetry build | |
- uses: softprops/[email protected] | |
with: | |
files: dist/* | |
test_publish_to_pypi: | |
environment: test_deployment | |
needs: test | |
name: Test publish to PyPI | |
if: startsWith(github.ref, 'refs/heads/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- run: pip install --upgrade pip poetry==1.1.12 | |
- uses: actions/checkout@v2 | |
- run: bash ./.github/scripts/publish.sh | |
env: | |
PYPI_TOKEN: ${{ secrets.pipy_token }} | |
REPO_URL: ${{ secrets.pypi_repository }} | |
publish_to_pypi: | |
environment: Production | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- run: pip install --upgrade pip poetry==1.1.12 | |
- uses: actions/checkout@v2 | |
- run: bash ./.github/scripts/publish.sh | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
REPO_URL: ${{ secrets.PYPI_REPOSITORY }} |