Skip to content

Commit

Permalink
Install mise at monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
mininny committed Feb 3, 2025
1 parent 8bc3933 commit edb234c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 7 deletions.
67 changes: 60 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
executors:
default:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.53.0
- image: cimg/base:2024.01

workflows:
main:
Expand Down Expand Up @@ -43,15 +43,68 @@ workflows:
commands:
install-dependencies:
steps:
- checkout
- run:
name: Install mise
command: curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
name: Initialize mise environment
command: |
# This is used to create a per-user cache key to preserve permissions across different
# executor types.
user=$(whoami)
echo "$user" > .executor-user
echo "Set executor user to $user."
if [[ "$user" == "root" ]]; then
# Self-hosted runners will persist this cache between runs. Cleaning it up means that we
# preserve the semantics of the cache regardless of executor type. It's also much faster
# to delete the cache and recreate it than it is to overwrite it in place.
rm -rf /data/mise-data
echo "Cleaned up cache data."
mkdir -p /data/mise-data
echo "Created Mise data dir."
mkdir -p ~/.cache
echo "Created Mise cache dir."
else
sudo rm -rf /data/mise-data
echo "Cleaned up cache data."
sudo mkdir -p /data/mise-data
sudo chown -R "$user:$user" /data/mise-data
echo "Created Mise data dir."
sudo mkdir -p ~/.cache
sudo chown -R "$user:$user" ~/.cache
echo "Created Mise cache dir."
fi
- restore_cache:
name: Restore mise cache
keys:
- mise-v5-{{ checksum ".executor-user" }}-{{ checksum "mise.toml" }}
- run:
name: Activate mise
command: echo 'eval "$(mise activate bash)"' >> $BASH_ENV
name: Install mise
command: |
if command -v mise &> /dev/null; then
echo "mise already installed at $(command -v mise)"
else
curl https://mise.run | sh
fi
echo "export PATH=\"$HOME/.local/bin:\$PATH\"" >> "$BASH_ENV"
echo "export MISE_DATA_DIR=/data/mise-data" >> "$BASH_ENV"
echo "export MISE_JOBS=$(nproc)" >> "$BASH_ENV"
echo "eval \"\$($HOME/.local/bin/mise activate --shims)\"" >> "$BASH_ENV"
- run:
name: Install mise dependencies
command: mise install
name: Install mise deps
command: |
mise install -v -y
if [ -f "rvsol/lib/optimism/mise.toml" ]; then
cd rvsol/lib/optimism
mise install -v -y
fi
- save_cache:
name: Save mise cache
key: mise-v5-{{ checksum ".executor-user" }}-{{ checksum "mise.toml" }}
paths:
- /data/mise-data

install-go-modules:
parameters:
Expand Down
1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
go = "1.22.7"
jq = "1.7.1"
just = "1.37.0"
python = "3.12.0"

# Code coverage
"ubi:codecov/codecov-cli" = "v10.0.1"
Expand Down

0 comments on commit edb234c

Please sign in to comment.