build(deps): bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #178
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: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10', 3.11] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: build | |
run: pip install . | |
- name: mypy check | |
run: | | |
mypy | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 ./src --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 ./src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest and check coverage | |
run: | | |
pytest --cov=estimators | |
build_wheel: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
pip install twine | |
- name: Build universal wheel | |
run: pip wheel . --no-deps --wheel-dir ./dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.whl | |
- name: Check wheels | |
run: twine check dist/* | |
- name: Test wheel | |
run: | | |
pip install --find-links dist/ vw-estimators | |
pytest | |
deploy_test: | |
name: "Upload if tag (test)" | |
environment: "Test-PyPi" | |
needs: [build_wheel, build] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
deploy_prod: | |
name: "Upload if tag (prod)" | |
environment: "Prod-PyPi" | |
needs: [deploy_test] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |