Judgment Datatypes #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Staging CI Tests | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- staging | |
permissions: read-all | |
jobs: | |
run-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: | |
- "3.11" | |
name: Test | |
runs-on: ${{ matrix.os }} | |
env: | |
PYTHONPATH: "." | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }} | |
JUDGMENT_DEV: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Initialize git submodules | |
run: | | |
git submodule update --init --recursive | |
- name: Install dependencies | |
run: | | |
pip install pipenv | |
pipenv install --dev | |
- name: Run tests | |
run: | | |
cd src | |
pipenv run pytest tests | |
run-e2e-tests-staging: | |
if: "!contains(github.actor, '[bot]')" # Exclude if the actor is a bot | |
name: Staging E2E Tests | |
runs-on: ubuntu-latest | |
env: | |
TEST_TIMEOUT_SECONDS: ${{ secrets.TEST_TIMEOUT_SECONDS }} | |
steps: | |
- name: Wait for turn | |
uses: softprops/turnstyle@v2 | |
with: | |
poll-interval-seconds: 10 | |
same-branch-only: false | |
job-to-wait-for: "Staging E2E Tests" | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-1 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install judgeval dependencies | |
run: | | |
pip install pipenv | |
pipenv install --dev | |
- name: Check if server is running | |
run: | | |
if ! curl -s https://staging.api.judgmentlabs.ai/health > /dev/null; then | |
echo "Staging Judgment server is not running properly. Check logs on AWS CloudWatch for more details." | |
exit 1 | |
else | |
echo "Staging server is running." | |
fi | |
- name: Run E2E tests | |
working-directory: src | |
run: | | |
SECRET_VARS=$(aws secretsmanager get-secret-value --secret-id gh-actions-stg-judgeval/api-keys/judgeval --query SecretString --output text) | |
export $(echo "$SECRET_VARS" | jq -r 'to_entries | .[] | "\(.key)=\(.value)"') | |
timeout ${TEST_TIMEOUT_SECONDS}s pipenv run pytest --durations=0 ./e2etests |