Skip to content

Merge pull request #43 from abitrolly/1.x #27

Merge pull request #43 from abitrolly/1.x

Merge pull request #43 from abitrolly/1.x #27

name: "Test & Release"
on:
push:
branches: [ "1.x"]
tags: [ "*" ]
pull_request:
branches: [ "1.x" ]
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- container: python:2
tox-envs: "sqla06-py27,sqla07-py27,sqla08-py27,sqla09-py27,sqlalchemy-py27"
- container: python:3
tox-envs: "sqlalchemy-py3"
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- name: "Install grapviz"
run: |
apt-get update
apt-get -y install graphviz
- name: Install tox flake8
run: |
python -m pip install tox flake8
- 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=127 --statistics
- name: "Test with tox"
run: |
tox -v -e ${{ matrix.tox-envs }} -- -v --color=yes
release:
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')"
runs-on: "ubuntu-latest"
needs: "test"
steps:
- uses: actions/checkout@v4
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install build
- name: "Build"
run: |
python -m build
git status --ignored
- name: "Publish"
uses: "pypa/gh-action-pypi-publish@release/v1"
with:
user: "__token__"
password: "${{ secrets.TEST_PYPI_API_TOKEN }}"
repository_url: "https://test.pypi.org/legacy/"