Skip to content

Commit

Permalink
reusable setup Java + ccm
Browse files Browse the repository at this point in the history
  • Loading branch information
ribaraka committed Oct 22, 2024
1 parent 35f6f40 commit cc44435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install Java and CCM
run: setup.sh
- name: List Files
run: ls -R
- name: Install Java and CCM
run: .github/workflows/setup.sh
17 changes: 4 additions & 13 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
set -e

install_java() {
if [ ! -d "$HOME/.sdkman" ]; then
echo "Installing SDKMAN..."
curl -s "https://get.sdkman.io" | bash
fi

echo "Installing SDKMAN..."
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
echo "sdkman_auto_answer=true" >> ~/.sdkman/etc/config

Expand All @@ -24,20 +21,14 @@ install_java() {
}

install_ccm() {
echo "Creating virtual environment..."
VENV_DIR="$HOME/venv"

if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment..."
python3 -m venv $VENV_DIR
fi

python3 -m venv $VENV_DIR
source $VENV_DIR/bin/activate
pip install --upgrade pip setuptools

echo "Installing CCM..."
pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}" || true

ccm -v || { echo "CCM installation failed"; exit 1; }
}

install_java
Expand Down

0 comments on commit cc44435

Please sign in to comment.