Merge pull request #347 from zowe/fix-346 #1677
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 single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Zowe SDK Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]') | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
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 --upgrade pip | |
pip install -r requirements.txt | |
- name: Lint with pydocstyle | |
run: pydocstyle --match-dir='^(?!(build|response)$).*' --match='^(?!(__init__\.py|setup\.py$)).*\.py$' src | |
- name: Lint with pydoclint | |
run: pydoclint --exclude='.*/(build|response)/.*' src | |
- name: Lint with pylint | |
run: | | |
# check for Python errors | |
pylint src --errors-only --disable=E0401,E0611 --ignore=build | |
# check for lint | |
pylint ./src --disable=all --enable=C0103,C0301 --ignore=build,response --max-line-length=127 | |
- name: Check license headers | |
run: python scripts/license_header.py src | |
- name: Test with pytest | |
run: | | |
coverage run -m pytest ./tests/unit | |
- name: Generate a coverage xml file | |
run: | | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
if: ${{ matrix.python-version == '3.12' }} | |
with: | |
directory: ./ | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} |