From 9beb8f54774ca0d41dd2eb7622809f4073676757 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 26 Nov 2019 12:06:30 +0100 Subject: ci: add github actions configuration --- src/bootstrap/test.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/bootstrap/test.rs') diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index aa1d1b7c424..e75868f7ebd 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -750,6 +750,35 @@ impl Step for Tidy { } } +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct ExpandYamlAnchors; + +impl Step for ExpandYamlAnchors { + type Output = (); + const ONLY_HOSTS: bool = true; + + /// Ensure the `generate-ci-config` tool was run locally. + /// + /// The tool in `src/tools` reads the CI definition in `src/ci/builders.yml` and generates the + /// appropriate configuration for all our CI providers. This step ensures the tool was called + /// by the user before committing CI changes. + fn run(self, builder: &Builder<'_>) { + builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); + try_run( + builder, + &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), + ); + } + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/tools/expand-yaml-anchors") + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(ExpandYamlAnchors); + } +} + fn testdir(builder: &Builder<'_>, host: Interned) -> PathBuf { builder.out.join(host).join("test") } -- cgit 1.4.1-3-g733a5