-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (97 loc) · 2.75 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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 }}