Skip to content

Commit

Permalink
fix(workflow): update actions and set python version
Browse files Browse the repository at this point in the history
  • Loading branch information
Pouyanpi committed Oct 26, 2024
1 parent c4b609a commit 0ebc07e
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/test-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: .venv
Expand Down Expand Up @@ -74,4 +74,44 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version:
python-version: ${{ matrix.python-version }}

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: built-wheel

- name: Install Wheel
run: |
pip install --user dist/*.whl
pip install --user dist/*.whl[dev]
- name: Run Tests
run: make test

- name: Start server in the background
run: |
nemoguardrails server &
echo "SERVER_PID=$!" >> $GITHUB_ENV
- name: Wait for server to be up
run: |
echo "Waiting for server to start..."
while ! curl --output /dev/null --silent --head --fail http://localhost:8000; do
printf '.'
sleep 1
done
echo "Server is up!"
- name: Check server status
run: |
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/v1/rails/configs)
if [ "$RESPONSE_CODE" -ne 200 ]; then
echo "Server responded with code $RESPONSE_CODE."
exit 1
fi
- name: Stop server
if: ${{ success() }}
run: |
kill $SERVER_PID

0 comments on commit 0ebc07e

Please sign in to comment.