Skip to content

Commit

Permalink
refactor: make nextest install multi-platform, merge in arm64
Browse files Browse the repository at this point in the history
Fixes lurk-lab#248

fix: manage tooling install in one place
  • Loading branch information
huitseeker committed Feb 20, 2023
1 parent 52c23ff commit fee0c34
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 41 deletions.
73 changes: 34 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,33 @@ commands:
name: Set the PATH env variable
command: |
# Also put the Rust LLVM tools into the PATH. `rustc` hooks into the rust-toolchain at the root of the repo
echo "export PATH=$HOME:~/.cargo/bin:$(dirname $(find $(rustc --print sysroot) -name 'rust-lld')):$PATH" | tee --append $BASH_ENV
echo "export PATH=$HOME:~/.cargo/bin:$(dirname $(find $(rustc --print sysroot) -name 'rust-lld')):$PATH" | tee -a $BASH_ENV
source $BASH_ENV
set_versions_n_runners:
steps:
- run:
name: Install rustup
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run:
name: Install nextest
command: |
# Get host target
host=$(rustc -Vv|grep host|sed -Ee 's/host: //')
# Debug
echo "Fetching nextest at https://get.nexte.st/latest/${host/*-apple-darwin/universal-apple-darwin}.tar.gz"
# If nextest isn't here already
[ -f ${CARGO_HOME:-~/.cargo/bin}/cargo-nextest ] ||
# Download binary and install to $HOME/.cargo/bin
curl -LsSf "https://get.nexte.st/latest/${host/*-apple-darwin/universal-apple-darwin}.tar.gz" | tar xzf - -C $HOME/.cargo/bin
- run:
name: Print versions
command: |
rustup show
cargo --version
rustc --version
save_rustup_cache:
steps:
- save_cache:
Expand All @@ -59,21 +83,13 @@ jobs:
environment: *setup-env
steps:
- checkout
- set_env_path
- run:
name: Update submodules
command: |
git submodule update --init --recursive
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: rustup show
- run: cargo --version
- run: rustc --version
- restore_rustup_cache
- run:
name: Install nextest
command: >
[ -f ${CARGO_HOME:-~/.cargo/bin}/cargo-nextest ] ||
curl -LsSf https://get.nexte.st/latest/linux |
tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- set_versions_n_runners
- run: cargo fetch
- run: rm -rf .git
- persist_to_workspace:
Expand Down Expand Up @@ -126,23 +142,13 @@ jobs:
- checkout
- run:
name: Update submodules
command: git submodule update --init --recursive
command: |
git submodule update --init --recursive
- attach_workspace:
at: "~/"
- set_versions_n_runners
- set_env_path
- install_gpu_deps
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: rustup show
- run: cargo --version
- run: cargo fetch
- run:
name: Install nextest
command: >
[ -f ${CARGO_HOME:-~/.cargo/bin}/cargo-nextest ] ||
curl -LsSf https://get.nexte.st/latest/linux-arm |
tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- run:
name: Arm64 Tests
command: cargo nextest run --profile ci --release --workspace
Expand All @@ -161,19 +167,8 @@ jobs:
command: git submodule update --init --recursive
- attach_workspace:
at: "~/"
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: rustup show
- run: cargo --version
- run: cargo fetch
- run:
name: Install nextest
command: >
[ -f ${CARGO_HOME:-~/.cargo/bin}/cargo-nextest ] ||
curl -LsSf https://get.nexte.st/latest/mac |
tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- set_versions_n_runners
- set_env_path
- run:
name: MacOS Tests
command: cargo nextest run --profile ci --release --workspace
Expand Down
3 changes: 1 addition & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[toolchain]
channel = "1.67.0"
targets = [ "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "wasm32-unknown-unknown" ]
components = [ "rustc", "cargo", "clippy", "rustfmt", "rust-src",
"rust-analysis", "rust-analyzer" ]
components = [ "rustc", "cargo", "clippy", "rustfmt", "rust-src", "rust-analysis", "rust-analyzer" ]
profile = "default"

0 comments on commit fee0c34

Please sign in to comment.