-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.41 KB
/
pytest-pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Pytest on PR
"on": pull_request
jobs:
pytest:
name: Run tests with pytest
# 実行環境として `ubuntu-latest` を選択
runs-on: ubuntu-latest
# 複数の Python のバージョンでテストするために `strategy.matrix` を設定
strategy:
matrix:
python-version: ["3.10"]
steps:
# リポジトリをチェックアウト
# See: https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v3
# Python のランタイムをセットアップ
# バージョンは `strategy.matrix` に並べたものを指定
# See: https://github.com/actions/setup-python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Poetry をインストール
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
# Poetry へのパスを通す
- name: Add path for Poetry
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH
# インストールした Poetry を使って必要な Python パッケージをインストール
- name: Install Dependencies
run: |
cd ./api
poetry install --no-interaction --no-root
# pytest を実行
- name: Run Tests
run: |
cd ./api
poetry run pytest