Reuse a shared requests.Session for RPC calls #149
Workflow file for this run
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: Lint and Test PlaidCloud RPC | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| PYTHON_VERSION: '3.12' | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| reviewdog: | |
| name: Lint PlaidCloud RPC w ReviewDog | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Ensure python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Acquire list of changed python files | |
| id: all-python-files | |
| continue-on-error: true | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: | | |
| **/*.py | |
| - name: Install dependencies | |
| run: pip install -e .[full]; pip install -q pylint==${{ secrets.PYLINT_VERSION }}; | |
| - name: License Checker | |
| uses: andersy005/gh-action-py-liccheck@main | |
| with: | |
| strategy-ini-file: ./liccheck.ini | |
| level: cautious | |
| requirements-txt-file: ./requirements.txt | |
| liccheck-version: ${{ secrets.LICCHECK_VERSION }} | |
| - name: Install ReviewDog | |
| uses: reviewdog/action-setup@v1 | |
| - name: Check Lint Warnings | |
| if: ${{ steps.all-python-files.outputs.any_changed == 'true' }} | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pylint -s n -f text -d E,R,C ${{ steps.all-python-files.outputs.all_changed_files }} 2>&1 | reviewdog -efm="%f:%l:%c: %m" -name="PyLint Warnings" -reporter=github-check -level=warning | |
| - name: Check Lint Errors | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pylint -s n -f text -E plaidcloud 2>&1 | reviewdog -efm="%f:%l:%c: %m" -name="PyLint Errors" -reporter=github-check -filter-mode=nofilter -fail-on-error | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: Ensure python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: pip install -e ".[test]" | |
| - name: Run pytest with coverage | |
| run: | | |
| pytest plaidcloud/rpc/tests/ -v \ | |
| --cov=plaidcloud.rpc \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml:coverage.xml \ | |
| --cov-fail-under=100 \ | |
| --junitxml=test-results.xml | |
| - name: Test Results | |
| if: always() | |
| uses: mikepenz/action-junit-report@v5 | |
| with: | |
| report_paths: test-results.xml | |
| check_name: Test Results | |
| - name: Pytest Coverage Comment | |
| if: always() | |
| uses: MishaKav/pytest-coverage-comment@v1.7.1 | |
| with: | |
| pytest-xml-coverage-path: coverage.xml | |
| junitxml-path: test-results.xml |