Skip to content

Commit

Permalink
Merge pull request #1 from nickswebsite/add-workflows
Browse files Browse the repository at this point in the history
Added workflows
  • Loading branch information
nickswebsite authored Aug 13, 2022
2 parents 4017d08 + b067ce8 commit cf4bb0d
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build
on:
push:
branches:
- master
- add-workflows
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install -U pip
python -m pip install flit
flit install --deps all
- name: Run Tests
run: |
tox --skip-missing-interpreters=false
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install -U pip
python -m pip install flit
flit install --deps all
- name: Ensure that the documentation can be built
run: |
cd docs && make html
- name: Ensure the package can be built
run: |
flit build
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Fakers for SQLAlchemy
=====================

|PyPI| |Supported Python versions| |Documentation| |Downloads|
|PyPI| |Build| |Supported Python versions| |Documentation| |Downloads|

`SQLAlchemy Faker <https://faker-sqlalchemy.readthedocs.io/en/latest/>`_ is a provider for the
`Faker <https://github.com/joke2k/faker>`_ library that helps populate `SQLAlchemy ORM <https://www.sqlalchemy.org/>`_
Expand Down Expand Up @@ -45,6 +45,8 @@ RNvnAvOpyEVAoNGnVZQU

.. |PyPI| image:: https://img.shields.io/pypi/v/faker_sqlalchemy
:target: https://pypi.org/project/faker_sqlalchemy/
.. |Build| image:: https://github.com/nickswebsite/faker-sqlalchemy/actions/workflows/package.yml/badge.svg
:target: https://github.com/nickswebsite/faker-sqlalchemy/actions/workflows/package.yml
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/faker_sqlalchemy.svg
:target: https://pypi.org/project/faker_sqlalchemy/
.. |Documentation| image:: https://readthedocs.org/projects/faker-sqlalchemy/badge/?version=latest
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ test = [
"tox >=4.0.b2",
]

github = [
"tox-gh-actions @ git+https://github.com/ymyzk/tox-gh-actions.git@tox4",
# Uncomment this when tox4 is officially released.
# "tox-gh-actions",
]

[project.urls]
Documentation = "https://faker-sqlalchemy.readthedocs.io/en/latest/"
Expand Down
6 changes: 6 additions & 0 deletions scripts/update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class _Badges:
"https://pepy.tech/badge/faker_sqlalchemy/month",
"Downloads",
)
CI = Badge(
"https://github.com/nickswebsite/faker-sqlalchemy/actions/workflows/package.yml",
"https://github.com/nickswebsite/faker-sqlalchemy/actions/workflows/package.yml/badge.svg",
"Build",
)


def main():
Expand All @@ -57,6 +62,7 @@ def main():

badges = [
_Badges.PYPI,
_Badges.CI,
_Badges.VERSIONS,
_Badges.RTFM,
_Badges.STATS,
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ basepython =
isolated_build = True
skip_missing_interpreters = false

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
commands = python -m unittest discover

Expand Down

0 comments on commit cf4bb0d

Please sign in to comment.