Skip to content

test latest push

test latest push #152

Workflow file for this run

name: code test
run-name: test latest push
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
- "feature/**"
jobs:
test:
name: test runner
runs-on: ubuntu-latest
env:
DEBUG: ${{ secrets.DEBUG }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
ACCESS_TOKEN_EXPIRE_MINUTES: ${{ secrets.ACCESS_TOKEN_EXPIRE_MINUTES }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
ALGORITHM: "HS256"
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "test"
POSTGRES_HOST: localhost
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: "x64"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest pytest-cov cryptography
pytest --disable-warnings -vv
build:
name: build runner
runs-on: ubuntu-latest
needs: test
env:
DEBUG: ${{ secrets.DEBUG }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
ACCESS_TOKEN_EXPIRE_MINUTES: ${{ secrets.ACCESS_TOKEN_EXPIRE_MINUTES }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
ALGORITHM: ${{ secrets.ALGORIGHTM }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "test"
POSTGRES_HOST: localhost
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: "x64"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run build
run: |
alembic revision --autogenerate -m "create tables"
alembic upgrade head