From 2f812b7110ff85db13190a280d6fb1e6f89cd2b7 Mon Sep 17 00:00:00 2001 From: Mohammad Nejati Date: Tue, 23 Apr 2024 20:27:54 +0000 Subject: [PATCH] Fix doc build script --- .github/workflows/ci.yml | 63 ++++------------------------------------ doc/generate-files.mjs | 6 ++++ 2 files changed, 11 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65b8ac18..2e39f105 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1012,6 +1012,9 @@ jobs: needs: [ runner-selection ] runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['ubuntu-latest'] }} steps: + - name: Clone Http.Proto + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: 18 @@ -1023,69 +1026,13 @@ jobs: compiler: clang version: 17 - - name: Clone Http.Proto - uses: actions/checkout@v3 - with: - path: http-proto-root - - - name: Clone Boost.Buffers - uses: actions/checkout@v3 - with: - path: buffers-root - repository: cppalliance/buffers - ref: develop - - - name: Clone Boost - uses: alandefreitas/cpp-actions/boost-clone@v1.8.0 - id: boost-clone - with: - branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} - boost-dir: boost-source - scan-modules-dir: http-proto-root - scan-modules-ignore: http_proto - - - name: Patch Boost - id: patch - shell: bash - run: | - set -xe - pwd - ls - ls -lah boost-source - - # Identify boost module being tested - module=${GITHUB_REPOSITORY#*/} - echo "module=$module" >> $GITHUB_OUTPUT - - # Identify GitHub workspace root - workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g') - echo -E "workspace_root=$workspace_root" >> $GITHUB_OUTPUT - - # Remove module from boost-source - rm -r "boost-source/libs/$module" || true - - # Copy cached boost-source to an isolated boost-root - cp -r boost-source boost-root - - # Set boost-root output - cd boost-root - boost_root="$(pwd)" - boost_root=$(echo "$boost_root" | sed 's/\\/\//g') - echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT - - # Patch boost-root with workspace module - cp -r "$workspace_root"/http-proto-root "libs/$module" - cp -r "$workspace_root"/buffers-root libs/buffers - - python3 tools/boostdep/depinst/depinst.py buffers - - name: Build Antora Docs run: | - cd boost-root/libs/http_proto/doc + cd doc bash ./build_antora.sh - name: Create Antora Docs Artifact uses: actions/upload-artifact@v3 with: name: antora-docs - path: boost-root/libs/http_proto/doc/build/site + path: doc/build/site diff --git a/doc/generate-files.mjs b/doc/generate-files.mjs index 2866e5a0..c792956f 100644 --- a/doc/generate-files.mjs +++ b/doc/generate-files.mjs @@ -169,6 +169,12 @@ if (isBoostDir(cwdParentParent)) { execSync('git submodule update --init --recursive', {cwd: boostDir}) console.log(`Cloned Boost to ${boostDir}`) + // Clone buffers + if (!fs.existsSync(path.join(boostDir, 'libs', 'buffers'))){ + execSync(`git clone https://github.com/CPPAlliance/buffers --depth 1 --branch ${boostBranch}`, + { cwd: path.join(boostDir, 'libs') }) + } + // Delete `self` from boost/libs const selfDir = path.join(boostDir, 'libs', self) console.log(`Deleting ${selfDir}`)