Update codecov/codecov-action action to v4 #29
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: Tests | |
on: [push] | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
name: "Verify code style" | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip # || pip3 install --upgrade pip | |
pip install -r requirements/requirements-std.txt | |
pip install flake8 | |
- name: Lint with flake8 | |
run: | | |
flake8 . | |
coverage: | |
name: "Coverage" | |
runs-on: windows-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements/requirements-std.txt | |
pip install -r requirements/requirements-dev.txt | |
- name: Install | |
run: | | |
python setup.py install | |
- name: Test with pytest | |
run: | | |
pytest --cov=markdown_changelog --cov-report=xml | |
continue-on-error: true | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
install: | |
strategy: | |
max-parallel: 2 | |
matrix: | |
python-version: [3.6, 3.7, 3.8] | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
timeout-minutes: 20 | |
runs-on: ${{ matrix.os }} | |
name: "Install & test" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements/requirements-std.txt | |
pip install -r requirements/requirements-dev.txt | |
- name: Install | |
run: | | |
python setup.py install | |
- name: Test | |
run: | | |
pytest . -v | |
deploy: | |
name: "Deploy" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip # || pip3 install --upgrade pip | |
pip install -r requirements/requirements-std.txt | |
pip install -r requirements/requirements-deploy.txt | |
- name: Build package | |
run: | | |
python setup.py sdist --formats=gztar bdist_wheel --universal | |
- name: Publish to Test PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
with: | |
skip_existing: true | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
with: | |
skip_existing: true | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |