forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add github actions configuration
- Loading branch information
1 parent
9d5c416
commit 9beb8f5
Showing
17 changed files
with
1,909 additions
and
12 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,6 +140,7 @@ mod format; | |
mod install; | ||
mod metadata; | ||
mod native; | ||
mod run; | ||
mod sanity; | ||
mod test; | ||
mod tool; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use crate::builder::{Builder, RunConfig, ShouldRun, Step}; | ||
use crate::tool::Tool; | ||
use std::process::Command; | ||
|
||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | ||
pub struct ExpandYamlAnchors; | ||
|
||
impl Step for ExpandYamlAnchors { | ||
type Output = (); | ||
const DEFAULT: bool = true; | ||
const ONLY_HOSTS: bool = true; | ||
|
||
/// Runs the `expand-yaml_anchors` tool. | ||
/// | ||
/// This tool in `src/tools` read the CI configuration files written in YAML and expands the | ||
/// anchors in them, since GitHub Actions doesn't support them. | ||
fn run(self, builder: &Builder<'_>) { | ||
builder.info("Expanding YAML anchors in the GitHub Actions configuration"); | ||
try_run( | ||
builder, | ||
&mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").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 try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { | ||
if !builder.fail_fast { | ||
if !builder.try_run(cmd) { | ||
let mut failures = builder.delayed_failures.borrow_mut(); | ||
failures.push(format!("{:?}", cmd)); | ||
return false; | ||
} | ||
} else { | ||
builder.run(cmd); | ||
} | ||
true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python | ||
# A simple wrapper that forwards the arguments to bash, unless the | ||
# CI_OVERRIDE_SHELL environment variable is present: in that case the content | ||
# of that environment variable is used as the shell path. | ||
|
||
import os | ||
import sys | ||
import subprocess | ||
|
||
try: | ||
shell = os.environ["CI_OVERRIDE_SHELL"] | ||
except KeyError: | ||
shell = "bash" | ||
|
||
res = subprocess.call([shell] + sys.argv[1:]) | ||
sys.exit(res) |
Oops, something went wrong.