Setup pydoctor_primer #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run pydoctor_primer | |
on: | |
# Only run on PR, since we diff against master | |
pull_request: | |
paths-ignore: | |
- 'pydoctor/test/**' | |
- 'docs/**' | |
- '*.rst' | |
- '*.txt' | |
- '*.in' | |
- '*.md' | |
- '.*' | |
- 'setup.py' | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
pydoctor_primer: | |
name: Run pydoctor_primer | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
shard-index: [0, 1, 2, 3, 4] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: pydoctor_to_test | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
pip install git+https://github.com/tristanlatr/pydoctor_primer.git | |
- name: Run pydoctor_primer | |
shell: bash | |
run: | | |
cd pydoctor_to_test | |
echo "new commit" | |
git rev-list --format=%s --max-count=1 $GITHUB_SHA | |
MERGE_BASE=$(git merge-base $GITHUB_SHA origin/$GITHUB_BASE_REF) | |
git checkout -b base_commit $MERGE_BASE | |
echo "base commit" | |
git rev-list --format=%s --max-count=1 base_commit | |
echo '' | |
cd .. | |
# fail action if exit code isn't zero or one | |
( | |
pydoctor_primer \ | |
--repo pydoctor_to_test \ | |
--new $GITHUB_SHA --old base_commit \ | |
--num-shards 5 --shard-index ${{ matrix.shard-index }} \ | |
--debug \ | |
--output concise \ | |
| tee diff_${{ matrix.shard-index }}.txt | |
) || [ $? -eq 1 ] | |
- name: Upload pydoctor_primer diff | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pydoctor_primer_diffs | |
path: diff_${{ matrix.shard-index }}.txt | |
- if: ${{ matrix.shard-index }} == 0 | |
name: Save PR number | |
run: | | |
echo ${{ github.event.pull_request.number }} | tee pr_number.txt | |
- if: ${{ matrix.shard-index }} == 0 | |
name: Upload PR number | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pydoctor_primer_diffs | |
path: pr_number.txt |