build(deps-dev): bump ruff from 0.14.9 to 0.14.13 in /webvh #4170
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: Linting and Unit Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - "**" | |
| push: | |
| branches: | |
| - main | |
| merge_group: | |
| jobs: | |
| linting-and-unit-tests: | |
| name: "Code quality and unit tests" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed-plugins: ${{ steps.changed-plugins.outputs.cache-hit }} | |
| steps: | |
| #---------------------------------------------- | |
| # Check out repo | |
| #---------------------------------------------- | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| #---------------------------------------------- | |
| # Install python and poetry with cache | |
| #---------------------------------------------- | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install poetry | |
| run: pipx install poetry==2.1.2 --python python3.13 | |
| id: setup-poetry | |
| #---------------------------------------------- | |
| # Get changed files | |
| #---------------------------------------------- | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v47.0.1 | |
| #---------------------------------------------- | |
| # Get changed plugins | |
| #---------------------------------------------- | |
| - name: Get changed plugins | |
| id: changed-plugins | |
| run: | | |
| # Collects all the plugin names that have changes. | |
| # If there is directory that isn't a plugin then it will need to skip it. Currently skipping plugin_globals | |
| declare -a changed_dirs=() | |
| for dir in ./*/; do | |
| current_folder=$(basename "$dir") | |
| if [[ $current_folder == "plugin_globals" ]]; then | |
| continue | |
| fi | |
| for changed_file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
| if [[ $changed_file == *"$current_folder"* ]]; then | |
| if ! [[ ${changed_dirs[*]} =~ $current_folder ]]; then | |
| changed_dirs+=("$current_folder") | |
| fi | |
| fi | |
| done | |
| done | |
| echo "changed-plugins=${changed_dirs[*]}" >> $GITHUB_OUTPUT | |
| #---------------------------------------------- | |
| # Install dependencies | |
| #---------------------------------------------- | |
| - name: Install dependencies | |
| id: install-dependencies | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| run: | | |
| for dir in ${{ steps.changed-plugins.outputs.changed-plugins }}; do | |
| echo "Installing dependencies for $dir" | |
| cd $dir | |
| echo "Installing dependencies for $dir" | |
| poetry install --no-interaction --no-root --all-extras | |
| cd .. | |
| done | |
| #---------------------------------------------- | |
| # Lint plugins | |
| #---------------------------------------------- | |
| - name: Lint plugins | |
| id: lint-plugins | |
| run: | | |
| for dir in ${{ steps.changed-plugins.outputs.changed-plugins }}; do | |
| echo "Linting $dir" | |
| cd $dir | |
| poetry run ruff check . | |
| poetry run ruff format --check . | |
| cd .. | |
| done | |
| #---------------------------------------------- | |
| # Unit tests | |
| #---------------------------------------------- | |
| - name: Unit test plugins | |
| id: unit-tests | |
| run: | | |
| for dir in ${{ steps.changed-plugins.outputs.changed-plugins }}; do | |
| echo "Running unit tests for $dir" | |
| cd $dir | |
| poetry run pytest | |
| cd .. | |
| done |