Skip to content

Commit

Permalink
ci: Added integration tests only on push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
asafgardin committed Dec 18, 2023
1 parent 4ad7a76 commit 759d95b
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Lint Python (isort)
run: |
poetry run inv isort
test:
unittests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -77,3 +77,44 @@ jobs:
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

integration-tests:
runs-on: ubuntu-latest

if: github.ref == 'refs/heads/main'

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: poetry.lock
- name: Set Poetry environment
run: |
poetry env use ${{ matrix.python-version }}
- name: Install dependencies
run: |
poetry install --all-extras
- name: Run Integration Tests
env:
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
poetry run pytest tests/integration_tests/
- name: Upload pytest integration tests results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

0 comments on commit 759d95b

Please sign in to comment.