Skip to content

[WIP] PR: Add Guidelines Cheks #2

[WIP] PR: Add Guidelines Cheks

[WIP] PR: Add Guidelines Cheks #2

Workflow file for this run

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: Check changed files
id: changed-files
uses: tj-actions/changed-files@v45
# Uncomment To compare changes between the current commit and the last pushed remote
# with:
# since_last_remote_commit: true
- name: List all changed files
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: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Get diff files
id: files-diff
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: List changed files
run: |
echo "${{ steps.files-diff.outputs.changed_files }}"