Skip to content

add benchmark

add benchmark #14

Workflow file for this run

name: CI
on:
push:
jobs:
static-analysis:
runs-on: ubuntu-22.04
env:
DDANG_DATABASE: ddang_test
steps:
- name: Check out the codes
uses: actions/checkout@v2
- name: Setup python environment
id: setup-python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v2
with:
key: poetry-1.4.2
path: ~/.local/
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
- name: Register Poetry bin
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Cache dependencies
id: cache-venv
uses: actions/cache@v2
with:
key: python-${{ steps.setup-python.outputs.python-version }}-poetry-lock-${{ hashFiles('poetry.lock') }}-toml-${{ hashFiles('pyproject.toml') }}-poetry-1.4.2
path: /home/runner/.cache/pypoetry/virtualenvs/
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install
- name: Run Black
run: poetry run black . --check
- name: Run Isort
run: poetry run isort . --check --diff
# - name: Run Mypy
# run: poetry run mypy .
- name: Run Toml Sort
run: poetry run toml-sort pyproject.toml --all --check
test:
services:
redis:
image: redis:7.0.12
ports:
- 127.0.0.1:6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mongodb:
image: bitnami/mongodb:5.0.16
ports:
- 27017:27017
env:
ALLOW_EMPTY_PASSWORD: yes
options: >-
--health-cmd "echo 'db.stats().ok' | mongo"
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-22.04
env:
LOG_LEVEL: DEBUG
steps:
- name: Set timezone to KST
run: |
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
- name: Check out the codes
uses: actions/checkout@v2
- name: Setup python environment
id: setup-python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v2
with:
key: poetry-1.4.2
path: ~/.local/
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
- name: Register Poetry bin
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Cache dependencies
id: cache-venv
uses: actions/cache@v2
with:
key: python-${{ steps.setup-python.outputs.python-version }}-poetry-lock-${{ hashFiles('poetry.lock') }}-toml-${{ hashFiles('pyproject.toml') }}
path: /home/runner/.cache/pypoetry/virtualenvs/
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install
- name: Run Pytest
run: |
poetry run coverage run -m pytest --asyncio-mode=auto
poetry run coverage report -m
poetry run coverage html