Skip to content
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

chore(docs): split docs build into small jobs #2356

Merged
merged 3 commits into from
May 29, 2023
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
145 changes: 103 additions & 42 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,59 +24,60 @@ concurrency:
cancel-in-progress: true

jobs:
build:
build-rust-doc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Build OpenDAL docs ----------------------------------------------
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
cache-key: "-docs"

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
cache-key: "-services-all"

- name: Build OpenDAL doc
run: cargo doc --lib --no-deps --all-features -p opendal
env:
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}

- name: Copy docs into build
run: |
cp -r ./target/doc ./website/static/docs/rust
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: rust-docs
path: ./target/doc

build-java-doc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'

# Build bindings/java docs --------------------------------------
- name: Build and test
working-directory: bindings/java
run: mvn javadoc:javadoc

- name: Copy docs into build
run: |
cp -r ./bindings/java/target/site/apidocs ./website/static/docs/java

# Set node.js environment -----------------------------------------
- uses: actions/setup-node@v3
- name: Upload docs
uses: actions/upload-artifact@v2
with:
node-version: '16'
- run: corepack enable
working-directory: bindings/nodejs
name: java-docs
path: ./bindings/java/target/site/apidocs

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
build-nodejs-doc:
runs-on: ubuntu-latest

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
steps:
- uses: actions/checkout@v3

# Build bindings/nodejs docs --------------------------------------
- name: Install dependencies
working-directory: bindings/nodejs
run: yarn install
Expand All @@ -85,16 +86,22 @@ jobs:
working-directory: bindings/nodejs
run: yarn docs

- name: Copy docs into build
run: |
cp -r ./bindings/nodejs/docs ./website/static/docs/nodejs
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: nodejs-docs
path: ./bindings/nodejs/docs

# Setup python environment ----------------------------------------
- uses: actions/setup-python@v4
build-python-doc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: '3.11'

# Build bindings/python docs --------------------------------------
- name: Install dependencies
working-directory: bindings/python
run: |
Expand All @@ -106,20 +113,74 @@ jobs:
working-directory: bindings/python
run: pdoc --output-dir ./docs opendal

- name: Copy docs into build
run: |
cp -r ./bindings/python/docs ./website/static/docs/python
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: python-docs
path: ./bindings/python/docs

build-website:
runs-on: ubuntu-latest
needs:
- build-rust-doc
- build-java-doc
- build-nodejs-doc
- build-python-doc

steps:
- uses: actions/checkout@v3

# Set node.js environment -----------------------------------------
- uses: actions/setup-node@v3
with:
node-version: '16'

- run: corepack enable
working-directory: bindings/nodejs

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

# Download docs ---------------------------------------------------
- name: Download rust docs
uses: actions/download-artifact@v2
with:
name: rust-docs
path: ./website/static/docs/rust

- name: Download nodejs docs
uses: actions/download-artifact@v2
with:
name: nodejs-docs
path: ./website/static/docs/nodejs

- name: Download python docs
uses: actions/download-artifact@v2
with:
name: python-docs
path: ./website/static/docs/python

- name: Download java docs
uses: actions/download-artifact@v2
with:
name: java-docs
path: ./website/static/docs/java

# Build website ---------------------------------------------------
- name: Install Dependencies
working-directory: website
run: |
yarn install
run: yarn install

- name: Build
working-directory: website
run: |
yarn build
run: yarn build

# Start deploy --------------------------------------------------
- name: Copy asf file
Expand Down