Skip to content

Commit b810e9b

Browse files
committed
chore: improve CI workflow for Poetry binary handling
- Enhanced the CI workflow to dynamically reference the Poetry binary from the GitHub workspace, ensuring compatibility across different environments. - Updated the PATH variable to include the workspace, facilitating access to the Poetry installation. - Added checks to verify the existence of the Poetry binary in multiple locations, improving robustness during dependency installation and test execution. These changes aim to streamline the CI process and enhance reliability in various environments.
1 parent c055eb2 commit b810e9b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/ci_prepare.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ jobs:
132132
run: |
133133
echo "$HOME/.local/bin" >> $GITHUB_PATH
134134
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
135+
echo "${{ github.workspace }}" >> $GITHUB_PATH
135136
136137
- name: Verify Poetry installation
137138
run: |
138-
poetry --version || $HOME/.local/bin/poetry --version || $HOME/.poetry/bin/poetry --version
139+
poetry --version || $HOME/.local/bin/poetry --version || $HOME/.poetry/bin/poetry --version || ${{ github.workspace }}/poetry --version
139140
140141
- name: Load cached Poetry dependencies
141142
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
@@ -149,24 +150,30 @@ jobs:
149150
- name: Install dependencies
150151
run: |
151152
POETRY_BIN="$HOME/.local/bin/poetry"
153+
if [ ! -f "$POETRY_BIN" ]; then
154+
POETRY_BIN="${{ github.workspace }}/poetry"
155+
fi
152156
if [ ! -f "$POETRY_BIN" ]; then
153157
POETRY_BIN="poetry"
154158
fi
155159
"$POETRY_BIN" install --with test --no-root --no-interaction
156160
shell: bash
157161
env:
158-
PATH: /usr/local/bin:/usr/bin:/bin:$HOME/.local/bin:$HOME/.poetry/bin
162+
PATH: /usr/local/bin:/usr/bin:/bin:$HOME/.local/bin:$HOME/.poetry/bin:${{ github.workspace }}
159163

160164
- name: Run tests with coverage
161165
run: |
162166
POETRY_BIN="$HOME/.local/bin/poetry"
167+
if [ ! -f "$POETRY_BIN" ]; then
168+
POETRY_BIN="${{ github.workspace }}/poetry"
169+
fi
163170
if [ ! -f "$POETRY_BIN" ]; then
164171
POETRY_BIN="poetry"
165172
fi
166173
"$POETRY_BIN" run pytest tests/ --cov=temporal_boost --cov-report=xml --cov-report=term --cov-report=html -v
167174
shell: bash
168175
env:
169-
PATH: /usr/local/bin:/usr/bin:/bin:$HOME/.local/bin:$HOME/.poetry/bin
176+
PATH: /usr/local/bin:/usr/bin:/bin:$HOME/.local/bin:$HOME/.poetry/bin:${{ github.workspace }}
170177

171178
- name: Upload coverage to Codecov
172179
if: matrix.python-version == '3.11'

0 commit comments

Comments
 (0)