-
Notifications
You must be signed in to change notification settings - Fork 11
114 lines (92 loc) · 2.84 KB
/
scheduled-smoke-test.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Smoke test
on:
# regular runs
schedule:
- cron: '0 0,6,12,18 * * *'
# allow button click
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
environment: Scheduled Testing
steps:
- uses: actions/checkout@v3
- name: Store commit
run: |
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: cache poetry install
uses: actions/cache@v3
id: cache-poetry
with:
path: ~/.local
key: poetry-1.7.1-0
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v3
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies with caching
run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Install with plugins
run: poetry install --no-interaction --sync --extras all_plugins
- name: Write secrets
env:
SECRETS_CONFIG: |
[anthropic]
api_key = "${{ secrets.ANTHROPIC_API_KEY }}"
[together]
api_key = "${{ secrets.TOGETHER_API_KEY }}"
[openai]
api_key = "${{ secrets.OPENAI_API_KEY }}"
[hugging_face]
token = "${{ secrets.HUGGING_FACE_TOKEN }}"
[google_ai]
api_key = "${{ secrets.GOOGLE_AI_API_KEY }}"
[demo]
api_key="12345"
run: |
mkdir -p config
echo "$SECRETS_CONFIG" > config/secrets.toml
- name: Test object creation with plugins
run: |
source .venv/bin/activate
pytest --expensive-tests
- name: Test v0.5 run
run: |
source .venv/bin/activate
modelbench benchmark -m 1 -v 0.5
- name: Test v1.0 run
run: |
source .venv/bin/activate
modelbench benchmark -m 1 -v 1.0
- name: Ensure the artifact published on Pypi still works as expected
run: |
rm -rf .venv
mkdir -p ../installation/config
cat ./tests/modelgauge_tests/data/install_pyproject.toml > ../installation/pyproject.toml
cd ../installation
touch ./config/secrets.toml
poetry lock
poetry install --no-root
poetry run modelgauge list-tests
- name: Discord notification
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: 'The smoke test for {{ EVENT_PAYLOAD.repository.full_name }} has failed. See <{{ EVENT_PAYLOAD.repository.html_url }}/actions>'