一部型でエラーが出ている部分の修正と整理 #60
Workflow file for this run
This file contains hidden or 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: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| 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: 3.12 | |
| - name: Cache virtual environment | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-venv- | |
| - name: Install dependencies | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install poetry | |
| poetry install | |
| ruff-format: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Restore virtual environment cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-venv- | |
| - name: Check ruff version | |
| run: | | |
| source .venv/bin/activate | |
| poetry run ruff --version | |
| - name: Run ruff format check | |
| run: | | |
| source .venv/bin/activate | |
| poetry run ruff format --check . | |
| ruff-lint: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Restore virtual environment cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-venv- | |
| - name: Set up Python environment | |
| run: source .venv/bin/activate | |
| - name: Check ruff version | |
| run: | | |
| source .venv/bin/activate | |
| poetry run ruff --version | |
| - name: Run ruff lint | |
| run: | | |
| source .venv/bin/activate | |
| 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: Restore virtual environment cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-venv- | |
| - name: Check mypy version | |
| run: | | |
| source .venv/bin/activate | |
| poetry run mypy --version | |
| - name: Run mypy type check | |
| run: | | |
| source .venv/bin/activate | |
| poetry run mypy . | |
| pytest: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Restore virtual environment cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-venv- | |
| - name: Run pytest | |
| run: | | |
| source .venv/bin/activate | |
| poetry run pytest tests/ |