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.

shrink image builder (#3144)

Sean Ayec733b6d66318
diff --git a/.github/workflows/build-rust-ci-image.yml b/.github/workflows/build-rust-ci-image.yml
index 876c8a0f19..3b63c5cfbf 100644
--- a/.github/workflows/build-rust-ci-image.yml
+++ b/.github/workflows/build-rust-ci-image.yml
@@ -4,13 +4,13 @@ on:
workflow_dispatch: {}
# Create a GitHub-hosted larger image-generation runner with this label before
-# running this workflow. After it succeeds, configure linux-extra-beefy to use
-# the generated `macro-rust-ci` custom image.
+# running this workflow. Keep its CPU/RAM/disk size at or below the smallest
+# runner size that should be allowed to use the generated custom image.
jobs:
build-rust-ci-image:
- runs-on: linux-extra-beefy-image-generation
+ runs-on: linux-rust-ci-image-generation-small
snapshot:
- image-name: macro-rust-ci
+ image-name: macro-rust-ci-small
version: 1.*
steps:
- uses: actions/checkout@v6
@@ -21,69 +21,16 @@ jobs:
set -euo pipefail
sudo apt-get update
sudo apt-get install -y \
- build-essential \
curl \
- jq \
- libssl-dev \
- lld \
- pkg-config \
postgresql-client \
- unzip \
- zstd
-
- - name: Install Rust toolchain
- shell: bash
- run: |
- set -euo pipefail
- if ! command -v rustup >/dev/null 2>&1; then
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
- echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- export PATH="$HOME/.cargo/bin:$PATH"
- fi
-
- toolchain="$(grep -E '^\s*channel\s*=' rust/rust-toolchain.toml | sed -E 's/.*"([^"]+)".*/\1/')"
- rustup toolchain install "$toolchain" --profile minimal --component clippy --component rustfmt
- rustup default "$toolchain"
- rustc --version
- cargo --version
- cargo clippy --version
- cargo fmt --version
-
- - name: Install Rust CI tools
- shell: bash
- run: |
- set -euo pipefail
- cargo install cargo-nextest --locked
- cargo install just --locked
- cargo install sqlx-cli --locked
-
- cargo nextest --version
- just --version
- sqlx --version
-
- - name: Install sccache
- shell: bash
- env:
- SCCACHE_VERSION: v0.15.0
- run: |
- set -euo pipefail
-
- archive="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz"
- basename="${archive%.tar.gz}"
- tmp_dir="$(mktemp -d)"
- trap 'rm -rf "$tmp_dir"' EXIT
-
- curl -fsSL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${archive}" \
- | tar -xz -C "$tmp_dir"
-
- sudo install -m 0755 "$tmp_dir/$basename/sccache" /usr/local/bin/sccache
- sccache --version
+ unzip
- name: Install Nix
shell: bash
run: |
set -euo pipefail
- curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
+ curl --http1.1 --retry 5 --retry-delay 5 --retry-all-errors \
+ --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install linux --no-confirm --init systemd \
--extra-conf "experimental-features = nix-command flakes" \
--extra-conf "trusted-users = root runner"
@@ -137,14 +84,17 @@ jobs:
set -euo pipefail
export NIX_REMOTE=daemon
export PATH="/nix/var/nix/profiles/default/bin:$PATH"
- rustc --version
- cargo --version
- cargo clippy --version
- cargo fmt --version
- cargo nextest --version
- just --version
- sqlx --version
- sccache --version
- ld.lld --version
nix --version
test -L /var/cache/nix/dev-shell
+ nix develop --profile /var/cache/nix/dev-shell --command bash -lc '
+ set -euo pipefail
+ rustc --version
+ cargo --version
+ cargo clippy --version
+ cargo fmt --version
+ cargo nextest --version
+ just --version
+ sqlx --version
+ sccache --version
+ mold --version
+ '