diff --git a/.github/workflows/validate-versions.yml b/.github/workflows/validate-versions.yml new file mode 100644 index 000000000..188154838 --- /dev/null +++ b/.github/workflows/validate-versions.yml @@ -0,0 +1,33 @@ +name: Version Check + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + +jobs: + check-versions: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install yq for toml parsing + run: pip install yq + + - name: Read Python versions from pyproject.toml + id: versions + run: | + PYTHON_VERSION=$(tomlq -r .tool.poetry.dependencies.python < pyproject.toml | tr -d '"') + MATPLOTLIB_VERSION=$(tomlq -r .tool.poetry.dependencies.matplotlib < pyproject.toml | tr -d '"') + + echo "python_version=$PYTHON_VERSION" >> $GITHUB_OUTPUT + echo "matplotlib_version=$MATPLOTLIB_VERSION" >> $GITHUB_OUTPUT + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ steps.versions.outputs.python_version }}