Skip to content

Commit

Permalink
Merge pull request #19 from DanCardin/dc/support-sqlalchemy-2
Browse files Browse the repository at this point in the history
  • Loading branch information
DanCardin authored Dec 21, 2022
2 parents 1d9b7f7 + 9ae29d2 commit 7219cd7
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 60 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/main.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Github Release/Publish PyPi

on:
push:
tags:
- "v*.*.*"

jobs:
gh-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true

publish-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.2.0

- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
83 changes: 83 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Test our minimum version bound, the highest version available,
# and something in the middle (i.e. what gets run locally).
python-version: ["3.7", "3.9", "3.11"]
sqlalchemy-version: ["1.3.0", "1.4.0"]

name: Python ${{ matrix.python-version }} Tests
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.2.0

- name: Set up cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: poetry install

- name: Install specific sqlalchemy version
run: |
poetry run pip install 'sqlalchemy~=${{ matrix.sqlalchemy-version }}'
- if: ${{ matrix.python-version == '3.9' }}
run: poetry run make lint

- run: poetry run make test

- name: Store test result artifacts
uses: actions/upload-artifact@v3
with:
path: coverage.xml

- name: Coveralls
env:
COVERALLS_FLAG_NAME: run-${{ inputs.working-directory }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
pip install tomli coveralls
coveralls --service=github
finish:
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install tomli coveralls
coveralls --service=github --finish
103 changes: 91 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ typing_extensions = ">=3.10"
pytest = {version = ">=1.0", optional = true}

[tool.poetry.dev-dependencies]
black = {version = "^21.11b1", allow-prereleases = true, python = ">=3.6"}
coverage = ">=5"
black = "22.3.0"
coverage = [
{version = ">=7", python = ">=3.7"},
{version = ">=6", python = "<3.7"},
]
flake8 = "*"
isort = ">=5"
mypy = "*"
Expand Down

0 comments on commit 7219cd7

Please sign in to comment.