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:
- 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 clonesxgboost-devops
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.