Skip to content

Merge pull request #53 from ShipEngine/update-poetry-lock #77

Merge pull request #53 from ShipEngine/update-poetry-lock

Merge pull request #53 from ShipEngine/update-poetry-lock #77

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
on:
push:
branches:
- main
pull_request:
branches:
- main
name: ShipEngine SDK CI
jobs:
lint_and_pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest tox pytest-cov coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
- name: Pytest
run: |
pytest
# Tox lint step disabled due to packaging conflicts - flake8 step above provides linting
# - name: Run linting environment and pre-commit hooks
# run: |
# tox -e lint
coveralls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox pytest pytest-cov coverage responses
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Pytest
run: |
pytest --cov=shipengine --cov-report=xml
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: Python Test Suite
format: cobertura
file: coverage.xml
coveralls_finish:
needs: coveralls
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true