From 9cb697c4f2418c61e3af510ddf53e99ed6fdb89e Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Mon, 25 Nov 2024 19:02:39 -0800 Subject: [PATCH] Document custom actions --- doc/contrib/ci.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/doc/contrib/ci.rst b/doc/contrib/ci.rst index b61c2a265cb2..f699d133b1c8 100644 --- a/doc/contrib/ci.rst +++ b/doc/contrib/ci.rst @@ -299,3 +299,33 @@ from the remote directory. # Download all files whose path matches the wildcard pattern python-package/dist/*.whl bash ops/pipeline/stash-artifacts.sh unstash "${REMOTE_PREFIX}" \ python-package/dist/*.whl + +----------------------------------------- +Custom actions in ``dmlc/xgboost-devops`` +----------------------------------------- + +XGBoost implements a few custom +`composite actions `_ +to reduce duplicated code within workflow YAML files. The custom actions are hosted in a separate repository, +`dmlc/xgboost-devops `_, to make it easy to test changes to the custom actions in +a pull request or a fork. + +In a workflow file, we'd refer to ``dmlc/xgboost-devops/{custom-action}@main``. For example: + +.. code-block:: yaml + + - uses: dmlc/xgboost-devops/miniforge-setup@main + with: + environment-name: cpp_test + environment-file: ops/conda_env/cpp_test.yml + +Each custom action consists of two components: + +* Main script (``dmlc/xgboost-devops/{custom-action}/action.yml``): dispatches to a specific version + of the implementation script (see the next item). The main script can clone ``xgboost-deops`` from + a specified fork at a particular ref, allowing us to easily test changes to the custom action. +* Implementation script (``dmlc/xgboost-devops/impls/{custom-action}/action.yml``): Implements the + custom script. + +This design was inspired by Mike Sarahan's work in +`rapidsai/shared-actions `_.