diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ad1a9439f0f..2fe1c92f11a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,7 +104,15 @@ commands: steps: - run: name: Install Matplotlib - command: python -m pip install --user -ve . + command: | + if [[ "$CIRCLE_BRANCH" == v*-doc ]]; then + # The v*-doc branches must build against the specified release. + version=${CIRCLE_BRANCH%-doc} + version=${version#v} + python -m pip install matplotlib==${version} + else + python -m pip install --user -ve . + fi - save_cache: key: build-deps-1 paths: diff --git a/.github/workflows/clean_pr.yml b/.github/workflows/clean_pr.yml index 05cc4f5039e5..51350aab6773 100644 --- a/.github/workflows/clean_pr.yml +++ b/.github/workflows/clean_pr.yml @@ -30,3 +30,14 @@ jobs: printf 'The following images were both added and modified in this PR:\n%s\n' "$am" exit 1 fi + - name: Check for invalid backports to -doc branches + if: endsWith(github.base_ref, '-doc') + run: | + git fetch --quiet origin "$GITHUB_BASE_REF" + base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')" + lib="$(git log "$base..HEAD^2" --pretty=tformat: --name-status -- lib src | + cut --fields 2 | sort || true)" + if [[ -n "$lib" ]]; then + printf 'Changes to the following files have no effect and should not be backported:\n%s\n' "$lib" + exit 1 + fi