Upgrade python actions #65
Workflow file for this run
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 workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: CI pipeline | |
on: | |
push: | |
pull_request: | |
release: | |
types: [published] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.12 | |
- name: Install dev dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dev.requirements.txt | |
- name: Lint with black | |
run: black --check emoji_data_python | |
- name: Lint with pylint | |
run: pylint emoji_data_python | |
- name : mypy type checking (allowed to fail for now) | |
run: mypy emoji_data_python || true | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dev dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dev.requirements.txt | |
- name: Test with pytest | |
run: | | |
pytest --cov-config .coveragerc --cov=emoji_data_python tests/ --cov-report term | |
deploy: | |
if: github.event_name == 'release' | |
needs: | |
- test | |
- lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel twine | |
pip install . | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: alexmick | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
sed -i "s|version=\"0.0.0\",|version=\"${GITHUB_REF/refs\/tags\//}\",|g" setup.py | |
python setup.py sdist bdist_wheel | |
twine upload dist/* |