Skip to content

โœจ feat: awesome jmy pagination #196

โœจ feat: awesome jmy pagination

โœจ feat: awesome jmy pagination #196

Workflow file for this run

name: "CI"
on:
push:
branches:
- "*"
- "*/*/*"
paths-ignore:
- "k8s/fastapi.yaml"
pull_request:
branches:
- main
paths-ignore:
- "k8s/fastapi.yaml"
permissions:
contents: write
actions: read
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-python-venv-${{ github.sha }}
restore-keys: |
${{ runner.os }}-python-venv-
- name: Install dependencies
run: |
pip install uv
uv sync --all-groups
uv pip install uv
- name: Slack webhook
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: fastapi-cookbook
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }}
if: always()
lint:
name: Lint
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-python-venv-${{ github.sha }}
restore-keys: |
${{ runner.os }}-python-venv-
- name: Check type, lint, format
run: |
source .venv/bin/activate
make lint
- name: Slack webhook
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: fastapi-cookbook
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }}
if: always()
test-sqlite:
name: Test SQLite
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-python-venv-${{ github.sha }}
restore-keys: |
${{ runner.os }}-python-venv-
- name: Run pytest
run: |
source .venv/bin/activate
make test
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
flags: sqlite
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
flags: sqlite
token: ${{ secrets.CODECOV_TOKEN }}
- name: Slack webhook
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: fastapi-cookbook
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }}
if: always()
test-mysql:
env:
DB_ROOT: "password"
DB_TYPE: "mysql"
DB_DRIVER: "aiomysql"
DB_HOST: "127.0.0.1"
DB_PORT: 3306
DB_USER: "test"
DB_PASSWORD: "test"
DB_NAME: "test"
DB_TABLE_CREATE: true
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{ env.DB_ROOT }}
# WARN: mysql:8.0 ์‚ฌ์šฉ ์‹œ MYSQL_PWD๋ฅผ ์„ค์ •ํ•˜๋ฉด ์•„๋ž˜ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.
# ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
# MYSQL_PWD: ${{ env.DB_ROOT }}
MYSQL_USER: ${{ env.DB_USER }}
MYSQL_PASSWORD: ${{ env.DB_PASSWORD}}
MYSQL_DATABASE: ${{ env.DB_NAME }}
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin -h 127.0.0.1 ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
name: Test MySQL
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-python-venv-${{ github.sha }}
restore-keys: |
${{ runner.os }}-python-venv-
# NOTE: ๊ธฐ๋ณธ์ ์œผ๋กœ GitHub Actions์˜ Ubuntu์—๋Š” ์•„๋ž˜ ์˜์กด์„ฑ์ด ์„ค์น˜๋œ ๊ฒƒ์œผ๋กœ ํ™•์ธ
# - name: Install MySQL dependencies
# run: |
# sudo apt-get update
# sudo apt-get install default-libmysqlclient-dev build-essential pkg-config -y
- name: Run pytest
run: |
source .venv/bin/activate
make test
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
flags: mysql
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
flags: mysql
token: ${{ secrets.CODECOV_TOKEN }}
- name: Slack webhook
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: fastapi-cookbook
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }}
if: always()
test-postgresql:
env:
DB_TYPE: "postgresql"
DB_DRIVER: "asyncpg"
DB_HOST: "127.0.0.1"
DB_PORT: 5432
DB_USER: "test"
DB_PASSWORD: "test"
DB_NAME: "test"
DB_TABLE_CREATE: true
services:
postgresql:
image: postgres:17
env:
PGPORT: ${{ env.DB_PORT }}
POSTGRES_USER: ${{ env.DB_USER }}
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
POSTGRES_DB: ${{ env.DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U $POSTGRES_USER -d dbname=$POSTGRES_DB -h 127.0.0.1 -p 5432"
--health-interval=10s
--health-timeout=5s
--health-retries=3
name: Test PostgreSQL
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-python-venv-${{ github.sha }}
restore-keys: |
${{ runner.os }}-python-venv-
- name: Run pytest
run: |
source .venv/bin/activate
make test
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
flags: postgresql
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
flags: postgresql
token: ${{ secrets.CODECOV_TOKEN }}
- name: Slack webhook
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: fastapi-cookbook
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }}
if: always()