Skip to content

Centralize JSON serialization and add type-aware payload encoding/decoding #274

Centralize JSON serialization and add type-aware payload encoding/decoding

Centralize JSON serialization and add type-aware payload encoding/decoding #274

Workflow file for this run

name: Validate
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Fallback path: on Python 3.9 the SDK's df_dumps / df_loads cannot
# be installed (azure-functions 2.x requires >=3.13 and the 1.26.0
# line requires >=3.10), so this leg exercises the legacy
# serialization fallback in df_serialization.
- python-version: "3.9"
functions-sdk: ""
# SDK path: Python 3.13 with the beta that first ships df_dumps /
# df_loads, exercising the SDK-delegated serialization branch.
# TODO: change to "azure-functions>=2.2.0" once 2.2.0 GA ships, and
# drop the explicit override step below.
- python-version: "3.13"
functions-sdk: "azure-functions>=2.2.0b5"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Functions SDK override
if: matrix.functions-sdk != ''
run: pip install "${{ matrix.functions-sdk }}"
- name: Run Linter
# Lint only on the canonical Python version. On Python 3.12+, PEP 701
# changed f-string tokenization so pycodestyle inspects tokens inside
# f-strings, producing false positives (e.g. the ':' in 'http://' or
# the indentation of multi-line f-string concatenations). Linting is
# environment-agnostic, so running it once on 3.9 is sufficient.
if: matrix.python-version == '3.9'
run: |
cd azure
flake8 . --count --show-source --statistics
- name: Run tests
run: |
pytest --ignore=samples-v2
test-samples:
strategy:
matrix:
app_name: [blueprint, fan_in_fan_out, function_chaining]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./samples-v2/${{ matrix.app_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r ../../requirements.txt
pip install ../.. --no-cache-dir --upgrade --no-deps --force-reinstall
- name: Run tests
run: |
python -m pytest