Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Merge pull request #9 from dokulabs/update-tests #138

Merge pull request #9 from dokulabs/update-tests

Merge pull request #9 from dokulabs/update-tests #138

Workflow file for this run

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