Add Event
class and functions
#32
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
name: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install linting dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements-dev.txt | |
- name: Install python package | |
run: python3 -m pip install . # Needed to guarantee dependencies are installed | |
- name: Lint with pylint | |
run: python3 -m pylint --rcfile=setup.cfg nhl/ | |
test-coverage: | |
name: Coverage | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Install testing dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements-dev.txt | |
- name: Install python package | |
run: python3 -m pip install . | |
- name: Test with pytest | |
run: python3 -m pytest --cov=nhl/ --cov-report=xml tests/ | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v2 | |
with: | |
fail_ci_if_error: false | |
verbose: true | |
build-wheel: | |
name: Build Wheel | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Build python package | |
run: | | |
python3 -m pip install --upgrade setuptools wheel twine | |
python3 setup.py sdist bdist_wheel | |
python3 -m twine check dist/* | |
- name: Upload wheel artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist/ | |
retention-days: 1 | |
test-latest: | |
name: Latest Dependencies | |
needs: build-wheel | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.7, 3.8, 3.9, "3.10"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install testing dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements-dev.txt | |
- name: Remove source code | |
uses: JesseTG/[email protected] | |
with: | |
path: nhl/ | |
- name: Download wheel artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
path: dist/ | |
- name: Install package wheel | |
run: | | |
python3 -m pip install $(ls dist/nhl-*.whl) | |
- name: Test with pytest | |
run: | | |
python3 -m pytest tests/ |