用 ssh2-python 重新实现 sftp 协议 #1786
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: Run Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
name: Unit Test (py${{ matrix.python-version}}, ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout Github Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install Python Packages | |
# if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
pip install -r requirements-hdfs.txt | |
pip install -r requirements-cli.txt | |
- name: Run unit-test | |
run: | | |
make test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
files: coverage.xml | |
env_vars: OS,PYTHON | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
style: | |
runs-on: ${{ matrix.os }} | |
name: Style Check (py${{matrix.python-version}}, ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout Github Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install Python Packages | |
# if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
pip install -r requirements-hdfs.txt | |
pip install -r requirements-cli.txt | |
- name: Run style-check | |
run: | | |
make style_check | |
static: | |
runs-on: ${{ matrix.os }} | |
name: Static Check (pytype, py${{matrix.python-version}}, ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout Github Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install Python Packages | |
# if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
pip install -r requirements-hdfs.txt | |
pip install -r requirements-cli.txt | |
- name: Run static-check | |
run: | | |
make static_check | |
security: | |
runs-on: ${{ matrix.os }} | |
name: Security Check (bandit, py${{ matrix.python-version }}, ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout Github Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install Python Packages | |
# if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
pip install -r requirements-hdfs.txt | |
pip install -r requirements-cli.txt | |
- name: Run bandit-check | |
continue-on-error: true | |
run: | | |
make bandit_check | |
- name: Expose SARIF Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Security SARIF Results | |
path: bandit-sarif.json | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: bandit-sarif.json | |
pyre: | |
runs-on: ${{ matrix.os }} | |
name: Static Check (pyre, py${{matrix.python-version}}, ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout Github Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install Python Packages | |
# if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
pip install -r requirements-hdfs.txt | |
pip install -r requirements-cli.txt | |
- name: Run pyre-check | |
continue-on-error: true | |
run: | | |
make pyre_check | |
- name: Expose SARIF Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SARIF Results | |
path: pyre-sarif.json | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: pyre-sarif.json |