Skip to content

Commit

Permalink
chore: modify install script to execute on user's repo and branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustaballer committed Aug 28, 2023
1 parent 09f4e71 commit 21e4942
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
# TODO: add windows matrix
os: [macos-latest]

env:
REPO: ${{ github.event.pull_request.head.repo.full_name }}
BRANCH: ${{ github.event.pull_request.head.ref }}
SKIP_POETRY_SHELL: 1

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -28,13 +33,13 @@ jobs:

- name: Run tests using the shell script (macOS compatible).
if: matrix.os == 'macos-latest'
run: SKIP_POETRY_SHELL=1 sh install/install_openadapt.sh
run: sh install/install_openadapt.sh

- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ env.BRANCH }}
repository: ${{ env.REPO }}

- name: Install poetry
uses: snok/install-poetry@v1
Expand Down
7 changes: 5 additions & 2 deletions install/install_openadapt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pythonCmd="python3.10"
pythonVerStr="Python 3.10*"
pythonInstallerLoc="https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg"

# Construct the repository URL
REPO_URL="https://github.com/$REPO"

################################ HELPER FUNCTIONS ################################

# Remove OpenAdapt if it exists
Expand Down Expand Up @@ -121,9 +124,9 @@ fi
CheckPythonExists

[ -d "OpenAdapt" ] && mv OpenAdapt OpenAdapt-$(date +%Y-%m-%d_%H-%M-%S)
RunAndCheck "git clone https://github.com/MLDSAI/OpenAdapt.git" "Clone git repo"

RunAndCheck "git clone $REPO_URL" "Clone git repo"
cd OpenAdapt
RunAndCheck "git checkout $BRANCH" "Checkout branch $BRANCH"

RunAndCheck "pip3.10 install poetry" "Install Poetry"
RunAndCheck "poetry install" "Install Python dependencies"
Expand Down

0 comments on commit 21e4942

Please sign in to comment.