-
-
Notifications
You must be signed in to change notification settings - Fork 87
74 lines (61 loc) · 2.07 KB
/
test_external.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: External tests
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
pull_request:
types: [ labeled, opened, synchronize, reopened ]
env:
MODULE_NAME: "spacy_llm"
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CO_API_KEY: ${{ secrets.CO_API_KEY }}
TEST_EXTERNAL: 1
jobs:
run:
runs-on: ubuntu-latest
if: "github.repository_owner == 'explosion' && (contains(github.event.pull_request.labels.*.name, 'Test external') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')"
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: "pip"
- name: Build sdist
run: |
python -m pip install -U build pip setuptools
python -m build --sdist
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Install from sdist
shell: bash
run: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
python -m pip install dist/$SDIST
- name: Test import
shell: bash
run: |
python -c "import $MODULE_NAME" -Werror
- name: Install test requirements
run: |
python -m spacy download en_core_web_md
python -m pip install -U -r requirements.txt -r requirements-dev.txt
- name: Run tests
shell: bash
run: python -m pytest --pyargs $MODULE_NAME -x
- name: Run usage tests
shell: bash
run: python -m pytest --pyargs usage_examples -x
# - name: Report Status
# if: always()
# uses: ravsamhq/notify-slack-action@v1
# with:
# status: ${{ job.status }}
# notification_title: "{workflow} have {status_message}"
# message_format: "{emoji} external workflow has {status_message}"
# notify_when: "failure"
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_MONITORING_WEBHOOK_URL }}