ci: add workflow to check for Python version consistency
Some checks are pending
Check Python Version Consistency / Check Python Version (push) Waiting to run
Some checks are pending
Check Python Version Consistency / Check Python Version (push) Waiting to run
This commit is contained in:
parent
5a10cdda3b
commit
7ae5ae1b26
33
.github/workflows/python_version_check.yml
vendored
Normal file
33
.github/workflows/python_version_check.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Check Python Version Consistency
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-version:
|
||||
name: Check Python Version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Compare versions
|
||||
run: |
|
||||
PYTHON_VERSION_FILE=".python-version"
|
||||
DOCKERFILE="agents/core-logic/Dockerfile.base"
|
||||
|
||||
PY_VERSION=$(cat $PYTHON_VERSION_FILE)
|
||||
DOCKER_PY_VERSION=$(grep "FROM python:" $DOCKERFILE | sed 's/FROM python:\(.*\)-slim/\1/')
|
||||
|
||||
echo "Python version from .python-version: $PY_VERSION"
|
||||
echo "Python version from Dockerfile: $DOCKER_PY_VERSION"
|
||||
|
||||
if [ "$PY_VERSION" != "$DOCKER_PY_VERSION" ]; then
|
||||
echo "::error::Python version mismatch!"
|
||||
echo "::error::.python-version specifies $PY_VERSION, but Dockerfile.base uses $DOCKER_PY_VERSION."
|
||||
exit 1
|
||||
fi
|
||||
echo "Python versions match."
|
||||
Loading…
Reference in New Issue
Block a user