Skip to content

[Testing] Provide a CI check for disallowed code changes #3579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 31, 2025
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
if: always()

needs:
- check-changed-folders
- integration-test
- test
- test_cygwin
Expand Down Expand Up @@ -173,6 +174,38 @@ jobs:
OS-${{ runner.os }},
VM-${{ matrix.platform }},
Py-${{ steps.python-install.outputs.python-version }}

check-changed-folders:
name: Check files
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files in the _distutils folder
id: changed-files-specific-distutils
uses: tj-actions/changed-files@v34
with:
files: |
setuptools/_distutils/**
- name: Get changed files in the _vendor folder
id: changed-files-specific-vendor
uses: tj-actions/changed-files@v34
with:
files: |
setuptools/_vendor/**
- name: Run step if any file(s) in the _distutils folder change
if: steps.changed-files-specific-distutils.outputs.any_changed == 'true'
run: |
echo "One or more files in the setuptools/_distutils folder has changed." | tee "${GITHUB_STEP_SUMMARY}"
exit 1
- name: Run step if any file(s) in the _vendor folder change
if: steps.changed-files-specific-vendor.outputs.any_changed == 'true'
run: |
echo "One or more files in the setuptools/_vendor folder has changed." | tee "${GITHUB_STEP_SUMMARY}"
exit 1

integration-test:
needs: test
Expand Down