This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.5 KB
/
tests.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
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: '0 0 1-31/15 * *'
env:
OPENAI_API_TOKEN: ${{ secrets.OPENAI_API_TOKEN }}
COHERE_API_TOKEN: ${{ secrets.COHERE_API_TOKEN }}
ANTHROPIC_API_TOKEN: ${{ secrets.ANTHROPIC_API_TOKEN }}
MISTRAL_API_TOKEN: ${{ secrets.MISTRAL_API_TOKEN }}
DOKU_URL: http://127.0.0.1:9044
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0
- name: Setup Doku Stack
run: docker-compose up -d
- name: Sleep for 30 seconds
run: sleep 30
- name: Make API Request and Set DOKU_TOKEN
run: |
RESPONSE=$(curl -X POST $DOKU_URL/api/keys \
-H 'Authorization: ""' \
-H 'Content-Type: application/json' \
-d '{"Name": "GITHUBACTION"}')
MESSAGE=$(echo $RESPONSE | jq -r '.message')
echo "DOKU_TOKEN=${MESSAGE}" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
- name: PyTest
run: |
pytest