Skip to content

[MNT] Update changelog generator script to return markdown files #3269

[MNT] Update changelog generator script to return markdown files

[MNT] Update changelog generator script to return markdown files #3269

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: code-quality
runs-on: ubuntu-latest
steps:
- name: repository checkout step
uses: actions/checkout@v6
- name: python environment step
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: install pre-commit
run: python3 -m pip install pre-commit
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr '\n' ' ')
echo "CHANGED_FILES=${CHANGED_FILES}" >> $GITHUB_ENV
- name: Print changed files
run: |
echo "Changed files:" && echo "$CHANGED_FILES" | tr ' ' '\n'
- name: Run pre-commit on changed files
run: |
if [ -n "$CHANGED_FILES" ]; then
pre-commit run --color always --files $CHANGED_FILES --show-diff-on-failure
else
echo "No changed files to check."
fi
run-notebook-tutorials:
name: Run notebook tutorials
needs: code-quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev,all_extras,github-actions]"
- name: Show dependencies
run: python -m pip list
- name: Run example notebooks
run: build_tools/run_examples.sh
shell: bash
pytest-nosoftdeps:
name: no-softdeps
needs: code-quality
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Setup macOS
if: runner.os == 'macOS'
run: |
brew install libomp # https://github.com/pytorch/pytorch/issues/20030
- name: Get full Python version
id: full-python-version
shell: bash
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Install dependencies
shell: bash
run: |
pip install ".[dev,github-actions]"
- name: Show dependencies
run: python -m pip list
- name: Run pytest
shell: bash
run: python -m pytest
pytest:
name: Run pytest
needs: pytest-nosoftdeps
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Setup macOS
if: runner.os == 'macOS'
run: |
brew install libomp # https://github.com/pytorch/pytorch/issues/20030
- name: Get full Python version
id: full-python-version
shell: bash
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Install dependencies
shell: bash
run: |
pip install ".[dev,all_extras,github-actions]"
- name: Show dependencies
run: python -m pip list
- name: Run pytest
shell: bash
run: python -m pytest
- name: Statistics
run: |
pip install coverage
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: always()
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: cpu,pytest
name: CPU-coverage
fail_ci_if_error: false