Updated package name and added github workflow
This commit is contained in:
parent
8a14b0033a
commit
693b824298
92
.github/workflows/ci.yml
vendored
Normal file
92
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
name: Test and Publish
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install pytest pytest-cov
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: pytest --cov=src/ttt_game --cov-report=xml tests
|
||||||
|
|
||||||
|
- name: Upload Coverage Report to Codecov.io
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
file: ./coverage.xml
|
||||||
|
flags: unittests
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install build
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: python -m build
|
||||||
|
|
||||||
|
- name: Archive production artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: built-files
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
publish-pypi:
|
||||||
|
needs: [test, build]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Download a single artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: built-files
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
- name: Publish package
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
|
||||||
|
publish-testing:
|
||||||
|
needs: [test, build]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Download a single artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: built-files
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
- name: Publish package
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||||
|
repository_url: https://test.pypi.org/legacy/
|
@ -1,10 +1,13 @@
|
|||||||
# Tic Tac Toe
|
# TTT-game
|
||||||
|
|
||||||
|
[](https://codecov.io/gh/dm1sh/tic-tac-toe)
|
||||||
|

|
||||||
|
|
||||||
A simple tic tac toe game implementation
|
A simple tic tac toe game implementation
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
tic-tac-toe module exports main game class `Game` and `Pl` and `Tr` enums to simplify typing.
|
tic_tac_toe module exports main game class `Game` and `Pl` and `Tr` enums to simplify typing.
|
||||||
|
|
||||||
### `Game` class
|
### `Game` class
|
||||||
|
|
||||||
|
6
setup.py
6
setup.py
@ -4,16 +4,16 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="tic-tac-toe-dm1sh",
|
name="ttt_game",
|
||||||
version="0.0.1",
|
version="0.0.1",
|
||||||
author="dm1sh",
|
author="dm1sh",
|
||||||
author_email="me@dmitriy.icu",
|
author_email="me@dmitriy.icu",
|
||||||
description="A simple tic tac toe game implementation",
|
description="A simple tic tac toe game implementation",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
url="https://github.com/dm1sh/tic-tac-toe",
|
url="https://github.com/dm1sh/ttt-game",
|
||||||
project_urls={
|
project_urls={
|
||||||
"Bug Tracker": "https://github.com/dm1sh/tic-tac-toe/issues",
|
"Bug Tracker": "https://github.com/dm1sh/ttt-game/issues",
|
||||||
},
|
},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from src.tic_tac_toe import Game, Tr
|
from src.ttt_game import Game, Tr
|
||||||
|
|
||||||
|
|
||||||
def test_init():
|
def test_init():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user