[Enhancement] Add logs for slow interfaces #11618
Workflow file for this run
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: CI DOC Checker | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- synchronize | |
branches: | |
- main | |
- 'branch*' | |
permissions: | |
issues: write | |
pull-requests: write | |
jobs: | |
doc-checker: | |
runs-on: ubuntu-latest | |
name: DOC FILTER | |
if: > | |
!contains(github.event.pull_request.title, '(sync #') && | |
!contains(github.event.pull_request.labels.*.name, 'sync') && | |
(!startsWith(github.head_ref, github.base_ref) || !contains(github.head_ref, '-sync-')) | |
outputs: | |
output1: ${{ steps.doc-changes-info.outputs.doc }} | |
steps: | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
doc: | |
- 'docs/**' | |
- name: DOC CHECK INFO | |
id: doc-changes-info | |
run: | | |
echo "doc=${{ steps.changes.outputs.doc }}" >> $GITHUB_OUTPUT | |
add-doc-label: | |
needs: doc-checker | |
runs-on: ubuntu-latest | |
name: ADD DOC LABEL | |
if: ${{ needs.doc-checker.outputs.output1 == 'true' }} | |
steps: | |
- name: add document label | |
uses: actions-ecosystem/action-add-labels@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
labels: documentation | |
markdownlint: | |
runs-on: ubuntu-latest | |
needs: add-doc-label | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
steps: | |
- name: clean | |
run: | | |
rm -rf ${{ github.workspace }} | |
mkdir -p ${{ github.workspace }} | |
- name: BRANCH INFO | |
id: branch | |
run: | | |
echo ${{github.base_ref}} | |
echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Checkout PR | |
run: | | |
BRANCH=${{steps.branch.outputs.branch}} | |
git config --global user.name "wanpengfei-git"; | |
git config --global user.email "[email protected]"; | |
git checkout $BRANCH; | |
git pull; | |
BRANCH_NAME="${BRANCH}-${PR_NUMBER}"; | |
git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}; | |
git checkout $BRANCH_NAME; | |
git checkout -b merge_pr; | |
git merge --squash --no-edit ${BRANCH} || (echo "::error::Merge conflict, please check." && exit -1); | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: articulate/[email protected] | |
with: | |
config: "docs/.markdownlint.yaml" | |
files: 'docs/**/*.md' | |
ignore: node_modules | |
version: 0.28.1 | |
- name: docusaurus-mdx-checker | |
if: always() | |
run: | | |
npx docusaurus-mdx-checker -c docs | |
- name: link check | |
if: always() | |
uses: lycheeverse/[email protected] | |
with: | |
fail: true | |
args: > | |
--config docs/lychee.toml | |
--offline "docs/**/*.md" | |
# To run a Docusaurus build on the docs as a final check | |
# checkout the test-harness | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'StarRocks/docusaurus-build' | |
path: 'docusaurus' | |
# mv the docs into the docusaurus dir where the | |
# docusaurus build job expects them to be | |
- run: mv docs docusaurus/ | |
# The README and contrib files have some sample markdown that fails | |
# link checking. StarRocks_intro.md uses a Gatsby component and will | |
# be replaced when we switch Gatsby off. Release notes we grab from | |
# main, so don't check in PRs. | |
- run: rm -f docusaurus/docs/README.md | |
- run: rm -f docusaurus/docs/feedback-and-contribute.md | |
- run: rm -f docusaurus/docs/introduction/StarRocks_intro.md | |
- run: rm -f docusaurus/docs/TOC.md | |
- run: rm -rf docusaurus/docs/release_notes | |
- name: Run Docusaurus build | |
working-directory: ./docusaurus | |
run: | | |
yarn install --frozen-lockfile | |
yarn build | |
behavior-unchange: | |
runs-on: ubuntu-latest | |
needs: add-doc-label | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
REPO: ${{ github.repository }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Set Body | |
run: | | |
body=$(gh pr view ${PR_NUMBER} -R ${REPO} --json body -q .body) | |
body=${body//"[x] Yes, this PR will result in a change in behavior."/"[ ] Yes, this PR will result in a change in behavior."} | |
body=${body//"[ ] No, this PR will not result in a change in behavior."/"[x] No, this PR will not result in a change in behavior."} | |
gh pr edit ${PR_NUMBER} -R ${REPO} -b "$body" |