1010 - main
1111 - develop
1212
13+ env :
14+ PYTHON_VERSION : 3.12
15+ PYTHON_CACHE_TYPE : ' poetry'
16+
1317jobs :
1418 # これ以降のジョブでキャッシュが使えるようにする
1519 setup :
@@ -18,12 +22,11 @@ jobs:
1822 - name : Checkout code
1923 uses : actions/checkout@v4
2024
21- - &setup-python
22- name : Set up Python
25+ - name : Set up Python
2326 uses : actions/setup-python@v5
2427 with :
25- python-version : 3.12
26- cache : ' poetry '
28+ python-version : ${{ env.PYTHON_VERSION }}
29+ cache : ${{ env.PYTHON_CACHE_TYPE }}
2730
2831 ruff-format :
2932 needs : setup
3235 - name : Checkout code
3336 uses : actions/checkout@v4
3437
35- - *setup-python
38+ - name : Set up Python
39+ uses : actions/setup-python@v5
40+ with :
41+ python-version : ${{ env.PYTHON_VERSION }}
42+ cache : ${{ env.PYTHON_CACHE_TYPE }}
3643
3744 - name : Check ruff version
3845 run : poetry run ruff --version
4754 - name : Checkout code
4855 uses : actions/checkout@v4
4956
50- - *setup-python
57+ - name : Set up Python
58+ uses : actions/setup-python@v5
59+ with :
60+ python-version : ${{ env.PYTHON_VERSION }}
61+ cache : ${{ env.PYTHON_CACHE_TYPE }}
5162
5263 - name : Check ruff version
5364 run : poetry run ruff --version
6273 - name : Checkout code
6374 uses : actions/checkout@v4
6475
65- - *setup-python
76+ - name : Set up Python
77+ uses : actions/setup-python@v5
78+ with :
79+ python-version : ${{ env.PYTHON_VERSION }}
80+ cache : ${{ env.PYTHON_CACHE_TYPE }}
6681
6782 - name : Check mypy version
6883 run : poetry run mypy --version
7792 - name : Checkout code
7893 uses : actions/checkout@v4
7994
80- - *setup-python
95+ - name : Set up Python
96+ uses : actions/setup-python@v5
97+ with :
98+ python-version : ${{ env.PYTHON_VERSION }}
99+ cache : ${{ env.PYTHON_CACHE_TYPE }}
81100
82101 - name : Run pytest
83102 run : |
84- source .venv/bin/activate
85103 poetry run pytest tests/
0 commit comments