Skip to content

Commit

Permalink
modif github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhaelbenilouz committed Nov 28, 2024
1 parent 475c6d5 commit 8599711
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/test-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@ name: Test API Predict

on:
push:
branches: [ "master" ]
branches: ["master", "mike-08"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:
test-api:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install pytest requests
- name: Build and start API container
run: |
docker compose build api_predict
docker compose up -d api_predict
- name: Wait for API to be ready
run: |
timeout 30s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8002/model_info)" != "200" ]]; do sleep 1; done' || false
- name: Run API tests
run: |
pytest tests/test_api_predict.py -v
- name: Docker logs on failure
if: failure()
run: docker compose logs api_predict
- name: Stop containers
if: always()
run: docker compose down
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install pytest requests
- name: Build and start API container
run: |
docker compose build api_predict
docker compose up -d api_predict
- name: Wait for API to be ready
run: |
timeout 30s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8002/model_info)" != "200" ]]; do sleep 1; done' || false
- name: Run API tests
run: |
pytest tests/test_api_predict.py -v
- name: Docker logs on failure
if: failure()
run: docker compose logs api_predict

- name: Stop containers
if: always()
run: docker compose down

0 comments on commit 8599711

Please sign in to comment.