From 04ed4c18688bd03fb23108185da63c9e3cf3018e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wawrzyniec=20Urba=C5=84czyk?= Date: Mon, 24 Jul 2023 15:53:03 +0200 Subject: [PATCH] CI fixes (#7375) This PR: * restores the previous naming scheme for 64-bit backend artifacts, * adds uploading of the Test Results reports. --- build/build/src/engine/context.rs | 23 ++++++++++++++++++++--- build/build/src/paths.rs | 2 +- project/DistributionPackage.scala | 9 +++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/build/build/src/engine/context.rs b/build/build/src/engine/context.rs index aad7d5b4ecb..c975b367264 100644 --- a/build/build/src/engine/context.rs +++ b/build/build/src/engine/context.rs @@ -22,6 +22,7 @@ use crate::paths::ENSO_TEST_JUNIT_DIR; use crate::project::ProcessWrapper; use ide_ci::actions::workflow::is_in_env; +use ide_ci::actions::workflow::MessageLevel; use ide_ci::cache; use ide_ci::github::release::IsReleaseExt; use ide_ci::platform::DEFAULT_SHELL; @@ -221,13 +222,16 @@ impl RunContext { ide_ci::fs::remove_if_exists(&self.paths.repo_root.engine.runtime.bench_report_xml)?; } - if self.config.test_standard_library { + let test_results_dir = if self.config.test_standard_library { // If we run tests, make sure that old and new results won't end up mixed together. let test_results_dir = ENSO_TEST_JUNIT_DIR .get() .unwrap_or_else(|_| self.paths.repo_root.target.test_results.path.clone()); - ide_ci::fs::reset_dir(test_results_dir)?; - } + ide_ci::fs::reset_dir(&test_results_dir)?; + Some(test_results_dir) + } else { + None + }; // Workaround for incremental compilation issue, as suggested by kustosz. // We target files like @@ -456,6 +460,19 @@ impl RunContext { enso.run_tests(IrCaches::Yes, &sbt, PARALLEL_ENSO_TESTS).await?; } + // If we are run in CI conditions and we prepared some test results, we want to upload + // them as a separate artifact to ease debugging. + if let Some(test_results_dir) = test_results_dir && is_in_env() { + // Each platform gets its own log results, so we need to generate unique names. + let name = format!("Test_Results_{TARGET_OS}"); + if let Err(err) = ide_ci::actions::artifacts::upload_compressed_directory(&test_results_dir, name) + .await { + // We wouldn't want to fail the whole build if we can't upload the test results. + // Still, it should be somehow visible in the build summary. + ide_ci::actions::workflow::message(MessageLevel::Warning, format!("Failed to upload test results: {err}")); + } + } + // if build_native_runner { // let factorial_input = "6"; // let factorial_expected_output = "720"; diff --git a/build/build/src/paths.rs b/build/build/src/paths.rs index 21b9e5c684b..42e18ecf3c3 100644 --- a/build/build/src/paths.rs +++ b/build/build/src/paths.rs @@ -56,7 +56,7 @@ pub fn new_repo_root(repo_root: impl Into, triple: &TargetTriple) -> ge pub fn pretty_print_arch(arch: Arch) -> &'static str { match arch { - Arch::X86_64 => "x64", + Arch::X86_64 => "amd64", Arch::AArch64 => "aarch64", _ => panic!("Unrecognized architecture {arch}"), } diff --git a/project/DistributionPackage.scala b/project/DistributionPackage.scala index 03a119e9fe3..20584e65904 100644 --- a/project/DistributionPackage.scala +++ b/project/DistributionPackage.scala @@ -456,10 +456,15 @@ object DistributionPackage { sealed trait Architecture { def name: String + + /** Name of the architecture for GraalVM releases + */ + def graalName: String } object Architecture { case object X64 extends Architecture { - override def name: String = "x64" + override def name: String = "amd64" + override def graalName: String = "x64" } val archs = Seq(X64) @@ -566,7 +571,7 @@ object DistributionPackage { s"https://github.com/graalvm/graalvm-ce-builds/releases/download/" + s"jdk-$graalJavaVersion/" + s"graalvm-community-jdk-${graalJavaVersion}_${os.name}-" + - s"${architecture.name}_bin${os.archiveExt}" + s"${architecture.graalName}_bin${os.archiveExt}" val exitCode = (url(graalUrl) #> archive).! if (exitCode != 0) { throw new RuntimeException(s"Graal download from $graalUrl failed.")