Skip to content

Make shared threads not require any auth #75

Make shared threads not require any auth

Make shared threads not require any auth #75

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Ansari CICD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
ansari-container-job:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
KALEMAT_API_KEY: ${{ secrets.KALEMAT_API_KEY }}
container: python:3.10
services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
PGPASSWORD: postgres
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-asyncio pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install PostgreSQL client
run: |
apt-get update
apt-get install --yes --no-install-recommends postgresql-client
- name: Create tables
env:
PGPASSWORD: postgres
POSTGRES_PASSWORD: postgres
run: |
for sql_file in sql/*.sql; do
psql -h postgres -p 5432 -U postgres -d postgres -f "$sql_file"
done
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
PGPASSWORD: postgres
POSTGRES_PASSWORD: postgres
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
run: |
pytest --capture=tee-sys --cov=.