Skip to content

init

init #1

Workflow file for this run

name: CI
on:
push:
jobs:
static-analysis:
runs-on: ubuntu-22.04
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:
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