Skip to content

[Github] Fetch number of commits in PR for docs action #69763

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

Merged
Merged
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
29 changes: 19 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,28 @@ jobs:
name: "Test documentation build"
runs-on: ubuntu-latest
steps:
- name: Fetch LLVM sources
# Fetch all the commits in a pull request so that the
# docs-changed-subprojects step won't pull them in itself in an extremely
# slow manner.
- name: Fetch LLVM sources (PR)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.pull_request.commits }}
- name: Fetch LLVM sources (push)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get subprojects that have doc changes
id: docs-changed-subprojects
uses: tj-actions/changed-files@v39
with:
files_yaml: |
llvm:
- 'llvm/docs/**'
clang:
- 'clang/docs/**'
- name: Setup Python env
uses: actions/setup-python@v4
with:
Expand All @@ -41,15 +59,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Get subprojects that have doc changes
id: docs-changed-subprojects
uses: tj-actions/changed-files@v39
with:
files_yaml: |
llvm:
- 'llvm/docs/**'
clang:
- 'clang/docs/**'
- name: Build LLVM docs
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
run: |
Expand Down