-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ability to send transactional Push Notifications (#15)
* feat: Add ability to send transactional Push Notifications
- Loading branch information
Showing
8 changed files
with
235 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
POETRY_VERSION: 1.5.1 | ||
|
||
jobs: | ||
create-virtualenv: | ||
runs-on: ubuntu-latest | ||
|
@@ -20,29 +23,26 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: pip cache | ||
uses: syphar/restore-pip-download-cache@v1 | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
env: | ||
POETRY_VERSION: 1.2.2 | ||
run: | | ||
pip install pip==22.3 setuptools==65.5.0 | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export VENV="$(poetry env info -p)" | ||
source ${VENV}/bin/activate | ||
poetry install --no-interaction | ||
- name: Install Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction -vv | ||
|
||
- name: Log currently installed packages and versions | ||
run: pip list | ||
run: poetry show | ||
|
||
release: | ||
needs: create-virtualenv | ||
|
@@ -60,11 +60,8 @@ jobs: | |
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
POETRY_VERSION: 1.2.2 | ||
POETRY_VERSION: ${{ env.POETRY_VERSION }} | ||
run: | | ||
pip install pip==22.3 setuptools==65.5.0 | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
poetry build | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ on: | |
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
POETRY_VERSION: 1.5.1 | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
create-virtualenv: | ||
|
@@ -30,34 +33,31 @@ jobs: | |
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: pip cache | ||
uses: syphar/restore-pip-download-cache@v1 | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
env: | ||
POETRY_VERSION: 1.2.2 | ||
run: | | ||
pip install pip==22.3 setuptools==65.5.0 | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export VENV="$(poetry env info -p)" | ||
source ${VENV}/bin/activate | ||
poetry install --no-interaction -vv | ||
- name: Install Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction -vv | ||
|
||
- name: Log currently installed packages and versions | ||
run: pip list | ||
run: poetry show | ||
|
||
linters-black: | ||
needs: create-virtualenv | ||
|
@@ -67,16 +67,30 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Check code style | ||
run: black --check --line-length=120 --diff async_customerio | ||
run: poetry run black --check --line-length=120 --diff async_customerio | ||
|
||
linters-mypy: | ||
needs: create-virtualenv | ||
|
@@ -86,18 +100,32 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Static type checker | ||
run: | | ||
python -m pip install types-setuptools | ||
mypy --install-types --no-error-summary --hide-error-codes --follow-imports=skip async_customerio | ||
poetry run mypy --install-types --no-error-summary --hide-error-codes --follow-imports=skip async_customerio | ||
test: | ||
needs: [ linters-black, linters-mypy ] | ||
|
@@ -110,18 +138,30 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run pytest | ||
run: pytest tests/ | ||
run: poetry run pytest tests/ | ||
|
||
- name: Submit coverage report | ||
if: github.ref == 'refs/heads/master' | ||
|
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
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
Oops, something went wrong.