-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from majiidd/develop
- Loading branch information
Showing
10 changed files
with
267 additions
and
243 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: ci | ||
|
||
on: [push] | ||
|
||
jobs: | ||
tests: | ||
name: ${{matrix.os}} / ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10', pypy-3.8] | ||
include: | ||
- python-version: '3.6' | ||
os: ubuntu-latest | ||
- python-version: pypy-3.9 | ||
os: ubuntu-latest | ||
- python-version: pypy-3.9 | ||
os: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Display Python version | ||
run: python --version | ||
|
||
- name: Get python path | ||
id: python-path | ||
run: | | ||
echo ::set-output name=path::$(python -c "import sys; print(sys.executable)") | ||
- name: Install pipenv | ||
run: | | ||
python -m pip install pipenv | ||
- name: Install dependencies | ||
env: | ||
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }} | ||
PYTHONIOENCODING: "utf-8" | ||
GIT_ASK_YESNO: "false" | ||
run: | | ||
pipenv install --dev --python=${{ steps.python-path.outputs.path }} | ||
- name: Install extra dependency (pytest on python <= 3.7) | ||
if: ${{ matrix.python-version == '3.6' || matrix.python-version == '3.7' }} | ||
run: | | ||
pipenv install --dev importlib_metadata | ||
- name: Install extra dependency (pytest on windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
pipenv install --dev atomicwrites | ||
- name: Run tests | ||
env: | ||
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }} | ||
PIPENV_NOSPIN: "1" | ||
GIT_ASK_YESNO: "false" | ||
PYTHONIOENCODING: "utf-8" | ||
run: | | ||
pipenv run pytest -ra --full-trace --cov=persiantools --cov-report xml:coverage.xml tests/ | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
fail_ci_if_error: true | ||
files: coverage.xml | ||
verbose: true | ||
|
||
build-and-publish: | ||
if: github.repository == 'majiidd/persiantools' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install pypa/build | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade build setuptools | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.