Update gitignore #44
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
name: Python CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.6, 3.7, 3.8] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: pip cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/Pipfile') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.python-version }}-pip- | |
- name: Install dependencies | |
run: | | |
pip install pipenv | |
pipenv install --dev | |
- name: Run black --check . | |
run: | | |
pipenv run black --check . | |
- name: Test with pytest | |
run: | | |
pipenv run python -m pytest | |
- name: Coverage with pytest-cov | |
run: | | |
pipenv run python -m pytest --cov=arc --cov-fail-under=51 --cov-report=html:output/coverage --cov-report=term | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: code-coverage-report ${{ matrix.os }} ${{ matrix.python-version }} | |
path: output/coverage/ | |
# Build python package | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install pypa/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- name: Publish distribution 📦 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 distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |