add build files #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 config virtualenvs.in-project true | |
poetry config virtualenvs.path "./.venv" | |
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 config virtualenvs.in-project true | |
poetry config virtualenvs.path "./.venv" | |
poetry install | |
- name: Run Pytest | |
run: | | |
poetry run coverage run -m pytest | |
poetry run coverage report -m | |
poetry run coverage html |