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

ci: move build_docs to gitlab #12531

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions .circleci/config.templ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,19 +430,6 @@ jobs:
- run_test:
pattern: 'aiobotocore'

build_docs:
# build documentation and store as an artifact
executor: ddtrace_dev
steps:
- checkout
- run:
command: |
hatch run docs:build
mkdir -p /tmp/docs
cp -r docs/_build/html/* /tmp/docs
- store_artifacts:
path: /tmp/docs

requires_pre_check: &requires_pre_check
requires:
- pre_check
Expand Down
2 changes: 2 additions & 0 deletions .gitlab-ci-local/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
1 change: 1 addition & 0 deletions .gitlab/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ download_dependency_wheels:
artifacts:
paths:
- "pywheels-dep/"

1 change: 1 addition & 0 deletions .gitlab/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include:
- local: ".gitlab/services.yml"
- local: ".gitlab/testrunner.yml"


.test_base_hatch:
extends: .testrunner
stage: hatch
Expand Down
10 changes: 0 additions & 10 deletions scripts/gen_circleci_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ def check(name: str, command: str, paths: t.Set[str]) -> None:
)


def gen_build_docs(template: dict) -> None:
"""Include the docs build step if the docs have changed."""
from needs_testrun import pr_matches_patterns

if pr_matches_patterns(
{"docker*", "docs/*", "ddtrace/*", "scripts/docs", "releasenotes/*", "benchmarks/README.rst"}
):
template["workflows"]["test"]["jobs"].append({"build_docs": template["requires_pre_check"]})


# -----------------------------------------------------------------------------

# The code below is the boilerplate that makes the script work. There is
Expand Down
22 changes: 22 additions & 0 deletions scripts/gen_gitlab_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,28 @@ def gen_required_suites() -> None:
print(str(jobspec), file=f)


def gen_build_docs() -> None:
"""Include the docs build step if the docs have changed."""
from needs_testrun import pr_matches_patterns

if True or pr_matches_patterns(
{"docker*", "docs/*", "ddtrace/*", "scripts/docs", "releasenotes/*", "benchmarks/README.rst"}
):
with TESTS_GEN.open("a") as f:
print("build_docs:", file=f)
print(" extends: .testrunner", file=f)
print(" stage: hatch", file=f)
print(" needs: []", file=f)
print(" script:", file=f)
print(" - |", file=f)
print(" hatch run docs:build", file=f)
print(" mkdir -p /tmp/docs", file=f)
print(" cp -r docs/_build/html/* /tmp/docs", file=f)
print(" artifacts:", file=f)
print(" paths:", file=f)
print(" - '/tmp/docs'", file=f)


def gen_pre_checks() -> None:
"""Generate the list of pre-checks that need to be run."""
from needs_testrun import pr_matches_patterns
Expand Down
Loading