diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f9286ddf..5e254865 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -410,3 +410,67 @@ jobs: OPENAI_API_KEY: "" run: | pytest -n 5 --durations=10 -m 'not pricy' --slowmo 1000 -v tests/assistantbench + + workarena-fast: + if: github.event_name == 'pull_request' + runs-on: ubuntu-22.04 + steps: + - name: Checkout Dependency Repo + uses: actions/checkout@v4 + + - name: Checkout WorkArena + uses: actions/checkout@v4 + with: + repository: ServiceNow/WorkArena + ref: workarena-plus-plus + path: WorkArena + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + + - name: Install dependencies + working-directory: WorkArena/dev + run: pip install -r requirements.txt + + - name: Install Playwright + run: playwright install --with-deps + + - name: Run fast tests + working-directory: WorkArena + env: + SNOW_INSTANCE_URL: ${{ secrets.SNOW_INSTANCE_URL }} + SNOW_INSTANCE_UNAME: ${{ secrets.SNOW_INSTANCE_UNAME }} + SNOW_INSTANCE_PWD: ${{ secrets.SNOW_INSTANCE_PWD }} + run: pytest -n 5 --durations=10 -m 'not slow and not pricy' --slowmo 1000 -v tests + + scheduled-workarena-slow: + if: github.event_name == 'schedule' + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Check for recent merge to main + id: check-merge + run: | + LAST_COMMIT_DATE=$(git log -1 --format=%ct) + CURRENT_DATE=$(date +%s) + DIFF=$((CURRENT_DATE - LAST_COMMIT_DATE)) + if [ $DIFF -le 86400 ]; then + echo "recent_merge=true" >> $GITHUB_OUTPUT + else + echo "recent_merge=false" >> $GITHUB_OUTPUT + fi + + - name: WorkArena slow tests + if: steps.check-merge.outputs.recent_merge == 'true' + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.PAT }} + repository: ServiceNow/WorkArena + event-type: dependency-update