Skip to content

Commit 28cf3f9

Browse files
authored
ARROW-12958: [CI][Developer] Build + host the docs for PR branches (#13913)
Authored-by: Jacob Wujciak-Jens <[email protected]> Signed-off-by: Rok <[email protected]>
1 parent 4af3df0 commit 28cf3f9

11 files changed

Lines changed: 100 additions & 21 deletions

File tree

‎ci/scripts/java_build.sh‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ if [[ "$(uname -s)" == "Linux" ]] && [[ "$(uname -m)" == "s390x" ]]; then
6464
fi
6565

6666
mvn="mvn -B -DskipTests -Drat.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
67+
68+
if [ $ARROW_JAVA_SKIP_GIT_PLUGIN ]; then
69+
mvn="${mvn} -Dmaven.gitcommitid.skip=true"
70+
fi
71+
6772
# Use `2 * ncores` threads
6873
mvn="${mvn} -T 2C"
6974

‎dev/archery/archery/bot.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ def submit(obj, tasks, groups, params, arrow_version):
259259

260260
# parse additional job parameters
261261
params = dict([p.split("=") for p in params])
262+
params['pr_number'] = pull_request.number
262263

263264
# instantiate the job object
264265
job = Job.from_config(config=config, target=target, tasks=tasks,

‎dev/tasks/docker-tests/github.linux.yml‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@ jobs:
2424
name: |
2525
Docker Test {{ flags|default("") }} {{ image }} {{ command|default("") }}
2626
runs-on: ubuntu-latest
27-
{% if env is defined %}
28-
env:
29-
{% for key, value in env.items() %}
30-
{{ key }}: "{{ value }}"
31-
{% endfor %}
32-
{% endif %}
27+
{{ macros.github_set_env(env) }}
3328
steps:
34-
{{ macros.github_checkout_arrow(fetch_depth=fetch_depth if fetch_depth is defined else 1)|indent }}
29+
{{ macros.github_checkout_arrow(fetch_depth=fetch_depth|default(1))|indent }}
3530
{{ macros.github_install_archery()|indent }}
3631

3732
- name: Execute Docker Build

‎dev/tasks/docs/github.linux.yml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
{% import 'macros.jinja' as macros with context %}
19+
{% set pr_number = pr_number|replace("Unset", arrow.branch) %}
20+
{{ macros.github_header() }}
21+
22+
jobs:
23+
test:
24+
name: Docs Preview
25+
runs-on: ubuntu-latest
26+
{{ macros.github_set_env(env) }}
27+
steps:
28+
{{ macros.github_checkout_arrow(fetch_depth=fetch_depth|default(1))|indent }}
29+
{{ macros.github_install_archery()|indent }}
30+
31+
- name: Execute Docker Build
32+
shell: bash
33+
env:
34+
ARROW_JAVA_SKIP_GIT_PLUGIN: true
35+
run: |
36+
archery docker run \
37+
-e SETUPTOOLS_SCM_PRETEND_VERSION="{{ arrow.no_rc_version }}" \
38+
{{ flags|default("") }} \
39+
{{ image }} \
40+
{{ command|default("") }}
41+
- name: Checkout Crossbow
42+
uses: actions/checkout@v3
43+
with:
44+
ref: {{ default_branch|default("master") }}
45+
path: crossbow
46+
fetch-depth: 1
47+
- name: Move docs
48+
run: |
49+
# build files are created by the docker user
50+
sudo chown -R ${USER}: build
51+
PR_DIR=crossbow/docs/pr_docs/{{ pr_number }}
52+
mkdir -p $PR_DIR
53+
rsync -a --delete build/docs/ $PR_DIR
54+
- name: Push changes
55+
run: |
56+
cd crossbow
57+
git config --local user.name "Github Actions"
58+
git config --local user.email "[email protected]"
59+
60+
URL_PATH=pr_docs/{{ pr_number }}
61+
URL=https://crossbow.voltrondata.com/$URL_PATH
62+
63+
git add docs/$URL_PATH
64+
git commit -m "Add docs preview for PR {{ pr_number }}"
65+
git push
66+
echo ":open_book: You can find the preview here: $URL" >> $GITHUB_STEP_SUMMARY

‎dev/tasks/fuzz-tests/github.oss-fuzz.yml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ jobs:
2323
test:
2424
name: OSS-Fuzz build test
2525
runs-on: ubuntu-latest
26-
{% if env is defined %}
27-
env:
28-
{% for key, value in env.items() %}
29-
{{ key }}: "{{ value }}"
30-
{% endfor %}
31-
{% endif %}
26+
{{ macros.github_set_env(env) }}
3227
steps:
3328
{{ macros.github_checkout_arrow()|indent }}
3429

‎dev/tasks/macros.jinja‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,12 @@ on:
352352

353353
{% set r_release = '4.2' %}
354354
{% set r_oldrel = '4.1' %}
355+
356+
{%- macro github_set_env(env) -%}
357+
{% if env is defined %}
358+
env:
359+
{% for key, value in env.items() %}
360+
{{ key }}: "{{ value }}"
361+
{% endfor %}
362+
{% endif %}
363+
{%- endmacro -%}

‎dev/tasks/python-minimal-build/github.linux.yml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ jobs:
2424
name: |
2525
Docker Python Minimal Build {{ flags|default("") }} {{ image }} {{ command|default("") }}
2626
runs-on: ubuntu-latest
27-
{% if env is defined %}
28-
env:
29-
{% for key, value in env.items() %}
30-
{{ key }}: "{{ value }}"
31-
{% endfor %}
32-
{% endif %}
27+
{{ macros.github_set_env(env) }}
3328
steps:
3429
{{ macros.github_checkout_arrow(submodules=false)|indent }}
3530

‎dev/tasks/r/github.packages.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# This allows us to set a custom version via param:
2121
# crossbow submit --param custom_version=8.5.3 r-binary-packages
2222
# if the param is unset defaults to the usual Ymd naming scheme
23-
{% set package_version = custom_version|default("\\2.\'\"$(date +%Y%m%d)\"\'") %}
23+
{% set package_version = custom_version|replace("Unset", "\\2.\'\"$(date +%Y%m%d)\"\'") %}
2424
{% set is_fork = macros.is_fork %}
2525

2626
{{ macros.github_header() }}

‎dev/tasks/tasks.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,8 @@ tasks:
969969
r-binary-packages:
970970
ci: github
971971
template: r/github.packages.yml
972+
params:
973+
custom_version: Unset
972974
artifacts:
973975
- r-lib__libarrow__bin__windows__arrow-[0-9\.]+\.zip
974976
- r-lib__libarrow__bin__centos-7__arrow-[0-9\.]+\.zip
@@ -1607,3 +1609,13 @@ tasks:
16071609
type: minimal_build
16081610
run: {{ kind }}
16091611
{% endfor %}
1612+
1613+
############################## Utility tasks ############################
1614+
preview-docs:
1615+
ci: github
1616+
template: docs/github.linux.yml
1617+
params:
1618+
pr_number: Unset
1619+
artifacts: "build/docs.tar.gz"
1620+
flags: "-v $PWD/build/:/build/"
1621+
image: ubuntu-docs

‎docker-compose.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,7 @@ services:
16421642
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
16431643
environment:
16441644
<<: *ccache
1645+
ARROW_JAVA_SKIP_GIT_PLUGIN:
16451646
ARROW_CUDA: "ON"
16461647
BUILD_DOCS_C_GLIB: "ON"
16471648
BUILD_DOCS_CPP: "ON"

0 commit comments

Comments
 (0)