upgrade pmd3 version from 2 to 4 #73
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 Package | |
on: | |
push: | |
branches: [master] | |
tags: | |
- v* | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Run tests with coverage | |
run: | | |
poetry run pytest --cov=. --cov-report xml --cov-report term | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
publish: | |
runs-on: ubuntu-latest | |
needs: test # 声明依赖于先前的测试作业 | |
if: startsWith(github.ref, 'refs/tags/') # 仅在标签推送时运行 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Build | |
run: | | |
poetry self add "poetry-dynamic-versioning[plugin]" | |
rm -fr dist/ && poetry build | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} | |
- name: Refresh Badge | |
run: | | |
curl -X PURGE https://camo.githubusercontent.com/8646ff049d2c966e398ae621ed8cd99ffe4b95ae9f5efe0fd57eda9425844104/68747470733a2f2f62616467652e667572792e696f2f70792f7469646576696365332e737667 |