Pull request check #538
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull request check | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: package/.venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('package/poetry.lock') }} | |
- name: Poetry install and build | |
run: | | |
cd package | |
python --version | |
poetry install --no-interaction | |
- name: Generate configuration for .env | |
run: | | |
cd package | |
touch .env | |
echo 'GENTRACE_API_KEY=${{ secrets.GENTRACE_API_KEY }}' >> .env | |
echo 'GENTRACE_HOSTNAME=${{ secrets.GENTRACE_HOSTNAME }}' >> .env | |
echo 'OPENAI_KEY=${{ secrets.OPENAI_KEY }}' >> .env | |
echo 'OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}' >> .env | |
echo 'OPENAI_ORG_ID=${{ secrets.OPENAI_ORG_ID }}' >> .env | |
echo 'PINECONE_API_KEY=${{ secrets.PINECONE_API_KEY }}' >> .env | |
echo 'PINECONE_ENVIRONMENT=${{ secrets.PINECONE_ENVIRONMENT }}' >> .env | |
- name: Run tests | |
run: | | |
cd package | |
poetry run pytest |