Bump werkzeug from 3.0.3 to 3.0.6 #451
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
name: run-tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
validate-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: fetch all history | |
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
- name: check for changes in dependency files | |
id: check-deps | |
run: | | |
echo "Checking pyproject.toml and poetry.lock for changes..." | |
BASE_BRANCH=${{ github.event.pull_request.base.ref }} | |
HEAD_BRANCH=${{ github.event.pull_request.head.ref }} | |
CHANGES=$(git diff --name-only origin/$BASE_BRANCH -- origin/$HEAD_BRANCH | grep -E "^(pyproject.toml|poetry.lock)$" || true) | |
echo "Changed files: $CHANGES" | |
if [ ! -z "$CHANGES" ]; then | |
echo "Checking if requirements.txt has also been updated..." | |
if ! git diff --name-only origin/$BASE_BRANCH -- origin/$HEAD_BRANCH | grep -q "requirements.txt"; then | |
echo "ERROR: pyproject.toml or poetry.lock has changed, but requirements.txt has not been updated." | |
echo "Please update requirements.txt by running 'make'." | |
exit 1 | |
fi | |
fi | |
- name: validate requirements.txt update | |
if: steps.check-deps.outputs.poetry_updated == 'true' | |
run: | | |
BASE_BRANCH=${{ github.event.pull_request.base.ref }} | |
HEAD_BRANCH=${{ github.event.pull_request.head.ref }} | |
REQUIREMENTS_CHANGE=$(git diff --name-only origin/$BASE_BRANCH -- origin/$HEAD_BRANCH | grep -q "requirements.txt") | |
echo "requirements.txt changed: $REQUIREMENTS_CHANGE" | |
if [ ! -z "$REQUIREMENTS_CHANGE" ]; then | |
echo "requirements.txt updated correctly." | |
else | |
echo "ERROR: pyproject.toml or poetry.lock has changed, but requirements.txt has not been updated." | |
echo "Please update requirements.txt by running 'make'." | |
exit 1 | |
fi | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: cache local deps | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: pydeps-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }} | |
- uses: snok/install-poetry@v1 | |
with: | |
version: 1.5.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: cache deps | |
id: cache-deps | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: poetry-1.5.1-${{ matrix.python-version }} | |
- run: poetry install --no-interaction --no-root | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
- run: poetry install --no-interaction | |
- name: Run pytest | |
run: poetry run pytest | |
- name: Debug output | |
run: echo "Testing completed for Python ${{ matrix.python-version }}" |