diff --git a/.github/workflows/run-backend-tests.yml b/.github/workflows/run-backend-tests.yml index 8e5145e681..c47579d473 100644 --- a/.github/workflows/run-backend-tests.yml +++ b/.github/workflows/run-backend-tests.yml @@ -1,9 +1,20 @@ name: Run Backend tests -on: [pull_request] +on: + pull_request: + paths: + - 'agenta-backend/**' + - 'docker-compose.yml' + - 'docker-compose.*.yml' + workflow_dispatch: + inputs: + debug: + description: 'Run Docker logs step (true/false)' + required: true + default: 'false' jobs: - continous_integration: + pytest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -33,8 +44,5 @@ jobs: run: sleep 10 && docker exec agenta-backend-test pytest - name: Docker logs - if: always() # + if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug == 'true' run: docker ps -q | xargs -I {} docker logs {} - - - name: Stop Docker Compose - run: docker-compose down diff --git a/.github/workflows/run-frontend-tests.yml b/.github/workflows/run-frontend-tests.yml index 7fd3c75b7e..a77d368bb3 100644 --- a/.github/workflows/run-frontend-tests.yml +++ b/.github/workflows/run-frontend-tests.yml @@ -1,6 +1,18 @@ name: Run Frontend tests -on: [pull_request] +on: + pull_request: + paths: + - 'agenta-web/**' + - 'docker-compose.yml' + - 'docker-compose.*.yml' + workflow_dispatch: + inputs: + debug: + description: 'Run Docker logs step (true/false)' + required: true + default: 'false' + env: OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }} @@ -49,5 +61,5 @@ jobs: run: cd agenta-web/ && npm run test - name: Docker logs - if: always() # + if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug == 'true' run: docker ps -q | xargs -I {} docker logs {}