@@ -3,7 +3,7 @@ version: 2.1
33executors :
44 default :
55 docker :
6- - image : us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.53.0
6+ - image : cimg/base:2024.01
77
88workflows :
99 main :
@@ -43,15 +43,68 @@ workflows:
4343commands :
4444 install-dependencies :
4545 steps :
46+ - checkout
4647 - run :
47- name : Install mise
48- command : curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
48+ name : Initialize mise environment
49+ command : |
50+ # This is used to create a per-user cache key to preserve permissions across different
51+ # executor types.
52+ user=$(whoami)
53+ echo "$user" > .executor-user
54+ echo "Set executor user to $user."
55+
56+ if [[ "$user" == "root" ]]; then
57+ # Self-hosted runners will persist this cache between runs. Cleaning it up means that we
58+ # preserve the semantics of the cache regardless of executor type. It's also much faster
59+ # to delete the cache and recreate it than it is to overwrite it in place.
60+ rm -rf /data/mise-data
61+ echo "Cleaned up cache data."
62+
63+ mkdir -p /data/mise-data
64+ echo "Created Mise data dir."
65+ mkdir -p ~/.cache
66+ echo "Created Mise cache dir."
67+ else
68+ sudo rm -rf /data/mise-data
69+ echo "Cleaned up cache data."
70+ sudo mkdir -p /data/mise-data
71+ sudo chown -R "$user:$user" /data/mise-data
72+ echo "Created Mise data dir."
73+ sudo mkdir -p ~/.cache
74+ sudo chown -R "$user:$user" ~/.cache
75+ echo "Created Mise cache dir."
76+ fi
77+ - restore_cache :
78+ name : Restore mise cache
79+ keys :
80+ - mise-v5-{{ checksum ".executor-user" }}-{{ checksum "mise.toml" }}
4981 - run :
50- name : Activate mise
51- command : echo 'eval "$(mise activate bash)"' >> $BASH_ENV
82+ name : Install mise
83+ command : |
84+ if command -v mise &> /dev/null; then
85+ echo "mise already installed at $(command -v mise)"
86+ else
87+ curl https://mise.run | sh
88+ fi
89+
90+ echo "export PATH=\"$HOME/.local/bin:\$PATH\"" >> "$BASH_ENV"
91+ echo "export MISE_DATA_DIR=/data/mise-data" >> "$BASH_ENV"
92+ echo "export MISE_JOBS=$(nproc)" >> "$BASH_ENV"
93+ echo "eval \"\$($HOME/.local/bin/mise activate --shims)\"" >> "$BASH_ENV"
5294 - run :
53- name : Install mise dependencies
54- command : mise install
95+ name : Install mise deps
96+ command : |
97+ mise install -v -y
98+ if [ -f "rvsol/lib/optimism/mise.toml" ]; then
99+ cd rvsol/lib/optimism/mise.toml
100+ mise install -v -y
101+ else
102+
103+ - save_cache :
104+ name : Save mise cache
105+ key : mise-v5-{{ checksum ".executor-user" }}-{{ checksum "mise.toml" }}
106+ paths :
107+ - /data/mise-data
55108
56109 install-go-modules :
57110 parameters :
0 commit comments