Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ci): size desktop runners and alert on native build failures (#8090)

Eric Hayesaf840c31314d
diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml
index f2014fee24..b53fce85ce 100644
--- a/.github/actionlint.yaml
+++ b/.github/actionlint.yaml
@@ -5,9 +5,13 @@ self-hosted-runner:
- linux-latest-middy
- namespace-profile-linux-mid
- namespace-profile-linux-mid;overrides.cache-tag=web-ci
+ - namespace-profile-linux-mid;overrides.cache-tag=desktop-linux
- namespace-profile-linux-small
- namespace-profile-linux-small;overrides.cache-tag=web-ci
- namespace-profile-linux-tiny-no-cache
- namespace-profile-linux-rust-ci
- namespace-profile-linux-rust-ci;overrides.cache-tag=sccache-ci
- nscloud-macos-sequoia-arm64-6x14
+ - nscloud-macos-sequoia-arm64-12x28-with-cache
+ - nscloud-cache-tag-macro-desktop-macos
+ - nscloud-cache-size-100gb
diff --git a/.github/workflows/alert-native-build-failures.yml b/.github/workflows/alert-native-build-failures.yml
new file mode 100644
index 0000000000..a0835c395a
--- /dev/null
+++ b/.github/workflows/alert-native-build-failures.yml
@@ -0,0 +1,68 @@
+# A completed workflow can report failures without exposing the Macro bot token
+# to the build runners or checking out code from a pull request.
+# Configure MACRO_BUILD_ALERT_WEBHOOK_URL (repository variable) and
+# MACRO_BUILD_ALERT_BOT_TOKEN (repository secret). The token is a channel-scoped
+# webhook credential for the Alerts channel.
+name: Alert native build failures
+
+on:
+ workflow_run:
+ workflows:
+ - Build Desktop on Tag
+ - iOS Preview
+ - Release Android App Bundle
+ types: [completed]
+
+permissions:
+ actions: read
+
+jobs:
+ alert:
+ if: contains(fromJSON('["failure", "timed_out"]'), github.event.workflow_run.conclusion)
+ runs-on: ubuntu-24.04
+ timeout-minutes: 10
+ steps:
+ - name: Notify Macro Alerts about failed native builds
+ env:
+ GH_TOKEN: ${{ github.token }}
+ SOURCE_RUN_ID: ${{ github.event.workflow_run.id }}
+ SOURCE_WORKFLOW: ${{ github.event.workflow_run.name }}
+ SOURCE_REF: ${{ github.event.workflow_run.head_branch }}
+ MACRO_WEBHOOK_URL: ${{ vars.MACRO_BUILD_ALERT_WEBHOOK_URL }}
+ MACRO_BOT_TOKEN: ${{ secrets.MACRO_BUILD_ALERT_BOT_TOKEN }}
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ failed_jobs=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$SOURCE_RUN_ID/jobs?per_page=100" --paginate |
+ jq -sr --arg workflow "$SOURCE_WORKFLOW" '
+ [.[].jobs[]
+ | select(.conclusion == "failure" or .conclusion == "timed_out")
+ | select(
+ if $workflow == "Build Desktop on Tag" then
+ .name == "Build AppImage" or .name == "Build macOS DMG"
+ elif $workflow == "iOS Preview" then
+ .name == "Build iOS simulator app and publish to Appetize"
+ elif $workflow == "Release Android App Bundle" then
+ .name == "Build signed Android App Bundle"
+ else false end
+ )
+ | .name] | unique | join(", ")
+ ')
+
+ # A release may fail in a deploy or publish job without a native build failing.
+ if [[ -z "$failed_jobs" ]]; then
+ exit 0
+ fi
+
+ if [[ -z "$MACRO_WEBHOOK_URL" || -z "$MACRO_BOT_TOKEN" ]]; then
+ echo 'Configure the Macro Alerts webhook URL and bot token' >&2
+ exit 1
+ fi
+ run_url="https://github.com/$GITHUB_REPOSITORY/actions/runs/$SOURCE_RUN_ID"
+ message="🚨 $SOURCE_WORKFLOW build failed on $SOURCE_REF. Failed jobs: $failed_jobs. $run_url"
+ jq -n --arg content "$message" '{content: $content}' |
+ curl --fail-with-body --silent --show-error --retry 3 \
+ --header 'Content-Type: application/json' \
+ --header "x-macro-channel-bot-token: $MACRO_BOT_TOKEN" \
+ --data-binary @- "$MACRO_WEBHOOK_URL"
diff --git a/.github/workflows/build_appimage_on_tag.yml b/.github/workflows/build_appimage_on_tag.yml
index 7c2678408a..1afa1f9c30 100644
--- a/.github/workflows/build_appimage_on_tag.yml
+++ b/.github/workflows/build_appimage_on_tag.yml
@@ -15,7 +15,7 @@ name: Build AppImage
jobs:
build-appimage:
name: Build AppImage
- runs-on: namespace-profile-linux-rust-ci
+ runs-on: namespace-profile-linux-mid;overrides.cache-tag=desktop-linux
steps:
- name: Checkout Repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
diff --git a/.github/workflows/build_desktop_on_tag.yml b/.github/workflows/build_desktop_on_tag.yml
index 9fc0776ebe..3ae3c90778 100644
--- a/.github/workflows/build_desktop_on_tag.yml
+++ b/.github/workflows/build_desktop_on_tag.yml
@@ -74,7 +74,7 @@ jobs:
needs:
- resolve-ref
name: Build AppImage
- runs-on: namespace-profile-linux-rust-ci
+ runs-on: namespace-profile-linux-mid;overrides.cache-tag=desktop-linux
steps:
- name: Checkout Repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
@@ -203,7 +203,7 @@ jobs:
- resolve-ref
name: Build macOS DMG
runs-on:
- - nscloud-macos-sequoia-arm64-6x14-with-cache
+ - nscloud-macos-sequoia-arm64-12x28-with-cache
- nscloud-cache-tag-macro-desktop-macos
- nscloud-cache-size-100gb
env:
diff --git a/.github/workflows/build_dmg_on_tag.yml b/.github/workflows/build_dmg_on_tag.yml
index da46f20bb0..3f6b98e896 100644
--- a/.github/workflows/build_dmg_on_tag.yml
+++ b/.github/workflows/build_dmg_on_tag.yml
@@ -16,7 +16,7 @@ jobs:
build-dmg:
name: Build macOS DMG
runs-on:
- - nscloud-macos-sequoia-arm64-6x14-with-cache
+ - nscloud-macos-sequoia-arm64-12x28-with-cache
- nscloud-cache-tag-macro-desktop-macos
- nscloud-cache-size-100gb
env:
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs
index b6b4614827..09aee83518 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs
@@ -52,7 +52,7 @@ pub fn build_appimage() -> Workflow {
pub fn build_appimage_job(ref_expr: &str) -> Job {
Job::default()
.name("Build AppImage")
- .runs_on(runners::Runner::RustCi.to_string())
+ .runs_on(runners::Runner::Mid.with_cache_tag("desktop-linux"))
.add_step(steps::checkout_ref(ref_expr))
.add_step(steps::mount_nix_cache_volume())
.add_step(steps::setup_nix())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rs
index 38430bcf7d..7e2ec1831e 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rs
@@ -6,6 +6,20 @@ fn rendered_yaml() -> String {
.expect("desktop workflow should serialize")
}
+#[test]
+fn desktop_release_uses_larger_isolated_runners() {
+ let yaml = rendered_yaml();
+ assert!(
+ yaml.contains("namespace-profile-linux-mid;overrides.cache-tag=desktop-linux"),
+ "{yaml}"
+ );
+ assert!(
+ yaml.contains("nscloud-macos-sequoia-arm64-12x28-with-cache"),
+ "{yaml}"
+ );
+ assert!(yaml.contains("nscloud-cache-tag-macro-desktop-macos"));
+}
+
#[test]
fn installers_publish_without_waiting_on_updater_signing() {
let yaml = rendered_yaml();
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs
index 078a0badb5..1b06d6884a 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs
@@ -34,7 +34,7 @@ pub fn build_dmg_job(ref_expr: &str) -> Job {
Job::default()
.name("Build macOS DMG")
.runs_on(vec![
- format!("{}-with-cache", runners::Runner::MacOsArm),
+ format!("{}-with-cache", runners::Runner::MacOsArmLarge),
"nscloud-cache-tag-macro-desktop-macos".to_owned(),
format!("nscloud-cache-size-{NIX_CACHE_SIZE_GB}gb"),
])
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs
index adef778a79..af6963dabb 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs
@@ -29,6 +29,8 @@ pub enum Runner {
/// Apple Silicon, for jobs that need a real Apple SDK. A machine label
/// rather than a dashboard profile, so it needs no setup outside this file.
MacOsArm,
+ /// Larger Apple Silicon machine for desktop release builds.
+ MacOsArmLarge,
}
impl fmt::Display for Runner {
@@ -39,6 +41,7 @@ impl fmt::Display for Runner {
Runner::Mid => "namespace-profile-linux-mid",
Runner::RustCi => "namespace-profile-linux-rust-ci",
Runner::MacOsArm => "nscloud-macos-sequoia-arm64-6x14",
+ Runner::MacOsArmLarge => "nscloud-macos-sequoia-arm64-12x28",
})
}
}