Skip to content

Commit 44fcdee

Browse files
committed
Use setup-rye action
Signed-off-by: Mattt Zmuda <[email protected]>
1 parent 70f6699 commit 44fcdee

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: actions/setup-python@v5
32+
- uses: eifinger/setup-rye@v2
3333
with:
34-
python-version: ${{ matrix.python-version }}
35-
cache: "pip"
34+
enable-cache: true
3635

3736
- name: Setup
3837
run: ./script/setup

script/setup

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,24 @@
22

33
set -eu
44

5-
: "${GITHUB_ACTIONS:=}"
65
: "${RYE_INSTALL_OPTION:='--yes'}"
76
: "${RYE_VERSION:='latest'}"
87

9-
install_rye() {
10-
curl -sSf https://rye-up.com/get | bash
11-
}
12-
13-
if [ -n "$GITHUB_ACTIONS" ]; then
14-
install_rye
15-
echo "$HOME/.rye/shims" >>"$GITHUB_PATH"
16-
elif ! command -v rye >/dev/null 2>&1; then
8+
if ! command -v rye > /dev/null 2>&1
9+
then
1710
echo "rye is not installed."
1811
printf "Do you want to install rye? (y/n) "
1912
read -r REPLY
20-
echo
21-
case "$REPLY" in
22-
[yY])
23-
echo "Installing rye..."
24-
install_rye
25-
echo "rye has been successfully installed."
26-
;;
27-
*)
28-
exit 1
29-
;;
13+
echo # move to a new line
14+
case "$REPLY" in
15+
[yY])
16+
echo "Installing rye..."
17+
curl -sSf https://rye-up.com/get | sh
18+
echo "rye has been successfully installed."
19+
;;
20+
*)
21+
exit 1
22+
;;
3023
esac
3124
else
3225
echo "rye is already installed."

0 commit comments

Comments
 (0)