Skip to content

[pre-commit.ci] pre-commit autoupdate #654

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #654

Workflow file for this run

# Most of this is inspired by the mypy primer
name: Primer
on:
pull_request:
jobs:
primer-run:
name: Run
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Check out working version
uses: actions/checkout@v4.2.2
with:
fetch-depth: 2
- name: Check out changeable version
uses: actions/checkout@v4.2.2
with:
path: program_to_test
fetch-depth: 0
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -U -r requirements.txt
- name: Run primer
shell: bash
run: |
cd program_to_test
echo "new commit"
git rev-list --format=%s --max-count=1 $GITHUB_SHA
MERGE_BASE=$(git merge-base $GITHUB_SHA origin/main)
git checkout -b base_commit $MERGE_BASE
echo "base commit"
git rev-list --format=%s --max-count=1 base_commit
echo "installing changeable version"
pip install -e .
cd ..
python -m pydocstringformatter._testutils.primer.primer --prepare
python -m pydocstringformatter._testutils.primer.primer --step-one
cd program_to_test
git checkout $GITHUB_SHA
cd ..
python -m pydocstringformatter._testutils.primer.primer --step-two
- name: Save PR number and copy fulldiff.txt
run: |
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
cp .pydocstringformatter_primer_tests/fulldiff.txt fulldiff.txt
- name: Upload primer diff and PR number
uses: actions/upload-artifact@v4.3.6
with:
name: primer_diffs
path: |
pr_number.txt
fulldiff.txt