Skip to content

ciの修正

ciの修正 #78

Workflow file for this run

name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
env:
PYTHON_VERSION: 3.12
PYTHON_CACHE_TYPE: 'poetry'
jobs:
# これ以降のジョブでキャッシュが使えるようにする
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: ${{ env.PYTHON_CACHE_TYPE }}
ruff-format:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: ${{ env.PYTHON_CACHE_TYPE }}
- name: Check ruff version
run: poetry run ruff --version
- name: Run ruff format check
run: poetry run ruff format --check .
ruff-lint:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: ${{ env.PYTHON_CACHE_TYPE }}
- name: Check ruff version
run: poetry run ruff --version
- name: Run ruff lint
run: poetry run ruff check --output-format=github .
mypy-type-check:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: ${{ env.PYTHON_CACHE_TYPE }}
- name: Check mypy version
run: poetry run mypy --version
- name: Run mypy type check
run: poetry run mypy .
pytest:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: ${{ env.PYTHON_CACHE_TYPE }}
- name: Run pytest
run: |
poetry run pytest tests/