Use larger runners for Linux CI steps (#11574)
Kirill Bulatov
created 2 years ago
To speed up Linux CI builds, use a set of self-hosted Linux machines and
use them to run all slow CI steps for Linux: "tests", bundling and
nightly builds.
Also adds a set of dev icons as Linux bundling script required them for
`run-bundling`-tagged builds from regular PRs.
Same icons as for Preview were used, but, ideally, something different
could be created.
Release Notes:
- N/A
Change summary
.github/workflows/ci.yml | 33 +++++++++++--------------
.github/workflows/release_nightly.yml | 14 +++-------
crates/zed/resources/app-icon-dev.png | 0
crates/zed/resources/app-icon-dev@2x.png | 0
script/linux | 6 ++--
5 files changed, 22 insertions(+), 31 deletions(-)
Detailed changes
@@ -104,23 +104,19 @@ jobs:
# todo(linux): Actually run the tests
linux_tests:
name: (Linux) Run Clippy and tests
- runs-on: ubuntu-latest
+ runs-on:
+ - self-hosted
+ - deploy
steps:
+ - name: Add Rust to the PATH
+ run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
+
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- - name: Cache dependencies
- uses: swatinem/rust-cache@v2
- with:
- save-if: ${{ github.ref == 'refs/heads/main' }}
-
- - name: configure linux
- shell: bash -euxo pipefail {0}
- run: script/linux
-
- name: cargo clippy
run: cargo xtask clippy
@@ -262,26 +258,25 @@ jobs:
bundle-linux:
name: Create a Linux bundle
- runs-on: ubuntu-22.04 # keep the version fixed to avoid libc and dynamic linked library issues
+ runs-on:
+ - self-hosted
+ - deploy
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
needs: [linux_tests]
env:
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
steps:
+ - name: Add Rust to the PATH
+ run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
+
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- - name: Cache dependencies
- uses: swatinem/rust-cache@v2
- with:
- save-if: ${{ github.ref == 'refs/heads/main' }}
-
- - name: Configure linux
- shell: bash -euxo pipefail {0}
- run: script/linux
+ - name: Limit target directory size
+ run: script/clear-target-dir-if-larger-than 100
- name: Determine version and release channel
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
@@ -96,7 +96,9 @@ jobs:
bundle-deb:
name: Create a Linux *.tar.gz bundle
if: github.repository_owner == 'zed-industries'
- runs-on: ubuntu-22.04 # keep the version fixed to avoid libc and dynamic linked library issues
+ runs-on:
+ - self-hosted
+ - deploy
needs: tests
env:
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
@@ -109,14 +111,8 @@ jobs:
clean: false
submodules: "recursive"
- - name: Cache dependencies
- uses: swatinem/rust-cache@v2
- with:
- save-if: ${{ github.ref == 'refs/heads/main' }}
-
- - name: Configure linux
- shell: bash -euxo pipefail {0}
- run: script/linux
+ - name: Add Rust to the PATH
+ run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Set release channel to nightly
run: |
@@ -1,12 +1,12 @@
-#!/usr/bin/bash
+#!/usr/bin/env bash
-set -e
+set -ex
# Install our submodule dependencies
git submodule update --init --recursive
# install the wasm toolchain
-rustup target add wasm32-wasi
+which rustup > /dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# if sudo is not installed, define an empty alias
maysudo=$(command -v sudo || command -v doas || true)