Skip to content

chore: update dependencies in pyproject.toml (major) #3794

chore: update dependencies in pyproject.toml (major)

chore: update dependencies in pyproject.toml (major) #3794

Workflow file for this run

name: Unit Test
on:
pull_request:
branches:
- "main"
- "release-**"
jobs:
check-if-test-is-needed:
runs-on: ubuntu-latest
permissions:
contents: read
actions: none
outputs:
run_tests: ${{ steps.determine.outputs.run_tests }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files_ignore: | # do not use quotes
- docs/**
- **.md
- doc_indexer/**
- CODEOWNERS
- LICENSE
- sec-scanners-config.yaml
- renovate.json
- external-images.yaml
- name: Determine if tests should run
id: determine
run: |
echo "Changed files: '${{ steps.changed-files.outputs.all_changed_files }}'"
if [ -z "${{ steps.changed-files.outputs.all_changed_files }}" ]; then
echo "No relevant files changed. Skipping tests."
echo "run_tests=false" >> $GITHUB_OUTPUT
else
echo "Relevant files changed. Running tests."
echo "run_tests=true" >> $GITHUB_OUTPUT
fi
## **IMPORTANT**: If any changes are made to how to run the unit tests. Make sure to update the steps for unit-tests
## in the create-release.yml workflow as well.
unit-test:
runs-on: ubuntu-latest
permissions:
contents: read
actions: none
needs: check-if-test-is-needed
if: needs.check-if-test-is-needed.outputs.run_tests == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract Python version
id: python-version
run: ./scripts/shell/extract-python-version.sh
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --with dev
- name: Create config.json
run: |
mkdir -p config
echo '{"mock-key": "mock-value"}' > config/config.json
- name: Run tests
run: poetry run poe test