Skip to content
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

[WIP] PR: Add Guidelines Cheks #23634

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/test-guidelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Guidelines Test
on:
push:
branches:
- master
- 6.*
- 5.*
paths:
- '.github/scripts/*.sh'
- '.github/workflows/*.yml'
- 'requirements/*.yml'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'
- '!installers-conda/**'
- '!.github/workflows/installers-conda.yml'
- '!.github/workflows/build-subrepos.yml'
- '!.github/workflows/purge-cache.yml'
- '!.github/scripts/installer_test.sh'
pull_request:
branches:
- master
- 6.*
- 5.*
paths:
- '.github/scripts/*.sh'
- '.github/workflows/*.yml'
- 'requirements/*.yml'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'
- '!installers-conda/**'
- '!.github/workflows/installers-conda.yml'
- '!.github/workflows/build-subrepos.yml'
- '!.github/workflows/purge-cache.yml'
- '!.github/scripts/installer_test.sh'
concurrency:
group: test-guidelines-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-check:
name: Check Style
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Install dependencies
run: python -m pip install ruff==0.9.4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
# since_last_remote_commit: true
files: |
*.py
- name: Lint check
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: ruff check -q --output-format=github ${ALL_CHANGED_FILES[@]}
changelog-check:
name: Check Changelog
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Install dependencies
run: python -m pip install packaging
- name: Run Check
id: run-check
run: |
if ${{ github.event_name == 'pull_request' }}; then
git diff ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -U0 | python tools/check_changelog.py --output-format=github
else
git diff ${{ github.event.before }} ${{ github.event.after }} -U0 | python tools/check_changelog.py --output-format=github
fi
Loading
Loading