Skip to content

Commit

Permalink
fix test workflow if ran from master, set xircuits lib install
Browse files Browse the repository at this point in the history
  • Loading branch information
MFA-X-AI committed Jan 24, 2024
1 parent 486b14d commit 1239748
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/run-workflow-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,27 @@ jobs:
- name: Install xircuits
run: pip install xircuits

- name: List xircuits
run: xircuits list

- name: Set COMPONENT_LIBRARY_PATH
- name: Set Environment Variables
run: |
REPO_NAME="${GITHUB_REPOSITORY##*/}"
COMPONENT_LIBRARY_PATH=$(echo "xai_components/xai_${REPO_NAME}" | sed 's/-/_/g')
LIBRARY_NAME=$(echo "${GITHUB_REPOSITORY##*/}" | sed 's/-/_/g')
echo "LIBRARY_NAME=$LIBRARY_NAME" >> $GITHUB_ENV
COMPONENT_LIBRARY_PATH="xai_components/${LIBRARY_NAME}"
echo "COMPONENT_LIBRARY_PATH=$COMPONENT_LIBRARY_PATH" >> $GITHUB_ENV
- name: Clone Pull Request
- name: List Xircuits
run: xircuits list

- name: Clone Repository
run: |
PR_BRANCH=${{ github.event.pull_request.head.ref }}
git clone -b $PR_BRANCH https://github.com/${{ github.repository }} ${{ env.COMPONENT_LIBRARY_PATH }}
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
git clone https://github.com/${{ github.repository }} ${{ env.COMPONENT_LIBRARY_PATH }}
else
PR_BRANCH=${{ github.event.pull_request.head.ref }}
git clone -b $PR_BRANCH https://github.com/${{ github.repository }} ${{ env.COMPONENT_LIBRARY_PATH }}
fi
- name: Install Component Library
run: xircuits install ${LIBRARY_NAME}

- name: Test .xircuits Workflows
run: |
Expand Down

0 comments on commit 1239748

Please sign in to comment.