From 9fd62e2304f40384bb84dcd71260641bdb0833c4 Mon Sep 17 00:00:00 2001 From: Jabber Developer Date: Wed, 17 Sep 2025 01:00:30 +0200 Subject: [PATCH] ci: restructure and optimize execution conditions - The code tests will ignore doc changes and vice versa. - The CI is split in 2 parts for clarity --- .github/workflows/ci-api-docs.yml | 44 +++++++++++++++++++++ .github/workflows/{main.yml => ci-code.yml} | 40 +++++-------------- 2 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci-api-docs.yml rename .github/workflows/{main.yml => ci-code.yml} (76%) diff --git a/.github/workflows/ci-api-docs.yml b/.github/workflows/ci-api-docs.yml new file mode 100644 index 00000000..5a44983c --- /dev/null +++ b/.github/workflows/ci-api-docs.yml @@ -0,0 +1,44 @@ +name: CI API Docs + +on: + push: + branches: [master] + paths: + - 'apidocs/**' + pull_request: + branches: [master] + paths: + - 'apidocs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test-c-api-docs: + runs-on: ubuntu-latest + name: Test C API Documentation Generation + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends make doxygen + - name: Test C API docs generation + run: | + cd apidocs/c/ + doxygen c-prof.conf + + test-python-api-docs: + runs-on: ubuntu-latest + name: Test Python API Documentation Generation + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends make python3-sphinx + - name: Test Python API docs generation + run: | + cd apidocs/python/ + sphinx-apidoc -f -o . src && make -j$(nproc) xml SPHINXOPTS="-W --keep-going -n" diff --git a/.github/workflows/main.yml b/.github/workflows/ci-code.yml similarity index 76% rename from .github/workflows/main.yml rename to .github/workflows/ci-code.yml index e4015b0d..d2e714ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ci-code.yml @@ -1,10 +1,18 @@ -name: CI +name: CI Code on: push: branches: [master] + paths-ignore: + - 'docs/**' + - 'apidocs/**' + - 'README.md' pull_request: branches: [master] + paths-ignore: + - 'docs/**' + - 'apidocs/**' + - 'README.md' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -83,38 +91,10 @@ jobs: continue-on-error: true steps: - uses: actions/checkout@v4 - - name: install dependencies + - name: Install dependencies run: | sudo apt update sudo apt install -y --no-install-recommends codespell - name: Check spelling run: | codespell - - test-c-api-docs: - runs-on: ubuntu-latest - name: Test C API Documentation Generation - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends make doxygen - - name: Test C API docs generation - run: | - cd apidocs/c/ - doxygen c-prof.conf - - test-python-api-docs: - runs-on: ubuntu-latest - name: Test Python API Documentation Generation - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends make python3-sphinx - - name: Test Python API docs generation - run: | - cd apidocs/python/ - sphinx-apidoc -f -o . src && make -j$(nproc) xml SPHINXOPTS="-W --keep-going -n"