Update README.md #222
Workflow file for this run
This file contains hidden or 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: pyinfraformat | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
pytest: | |
name: Run tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip setuptools | |
python -m pip install --no-cache-dir wheel | |
python -m pip install --no-cache-dir -r requirements.txt | |
- name: Show libraries | |
run: | | |
python -m pip freeze | |
- name: Build wheel | |
run: | | |
python setup.py bdist_wheel | |
- name: Install wheel | |
if: matrix.os != 'windows-latest' | |
run: | | |
python -m pip install dist/*.whl | |
- name: Install wheel [Windows] | |
if: matrix.os == 'windows-latest' | |
run: | | |
$whl = Get-ChildItem -Path dist -Filter *.whl | Select-Object -First 1 | |
python -m pip install "$whl" | |
- name: Install dev dependencies | |
run: | | |
python -m pip install --no-cache-dir -r requirements-dev.txt | |
- name: Run ruff format | |
run: | | |
python -m ruff format --check pyinfraformat/ | |
- name: Run ruff lint | |
run: | | |
python -m ruff check pyinfraformat | |
- name: Run tests | |
run: | | |
mkdir testing_folder | |
cd testing_folder | |
python -m pytest -v --cov=../pyinfraformat --durations=0 ../tests | |
- name: Upload wheel to release | |
uses: svenstaro/upload-release-action@v2 | |
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/*.whl | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
- name: Upload to pypi | |
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python -m pip install --no-cache-dir twine | |
python -m twine upload -u ${TWINE_USERNAME} -p ${TWINE_PASSWORD} --skip-existing dist/* |