Skip to content

Commit

Permalink
Fix: 自前で Poetry のキャッシュを取るように変更
Browse files Browse the repository at this point in the history
actions/setup-python は macos-12 と macos-14 でアーキテクチャが異なる事を理解していないのかキャッシュキーに OS バージョンやアーキテクチャが含まれておらず、また独自に設定することもできないため、結果 Intel Mac 向けパッケージがキャッシュされた場合 M1 Mac でキャッシュを使おうとするとネイティブ wheel のインストールに失敗する
マジで何とかしてくれよ…
  • Loading branch information
tsukumijima committed Jul 14, 2024
1 parent 457ec58 commit 03dee85
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 24 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ jobs:
- name: <Setup> Check out the repository
uses: actions/checkout@v4

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Cache Poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: <Setup> Install Python dependencies
run: poetry install --only=main
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/build-engine-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,21 @@ jobs:
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1

- name: <Setup> Install Poetry
run: python -m pip install poetry

# Python install path of windows: C:/hostedtoolcache/windows/Python
- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.architecture }}
cache: poetry

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Cache Poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: <Setup> Install Python dependencies
run: poetry install --with=build
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test-engine-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,19 @@ jobs:
- name: <Setup> Check out the repository
uses: actions/checkout@v4

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Cache Poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: <Setup> Install Python dependencies
run: poetry install --with=test
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test-engine-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ jobs:
- name: <Setup> Check out the repository
uses: actions/checkout@v4

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Cache Poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: <Setup> Download ENGINE package
run: |
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ jobs:
- name: <Setup> Check out the repository
uses: actions/checkout@v4

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Cache Poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: <Setup> Install Python dependencies
run: poetry install --with=test
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@ jobs:
- name: <Setup> Check out the repository
uses: actions/checkout@v4

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: <Setup> Install Poetry
run: python -m pip install poetry

- name: <Setup> Cache Poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: <Setup> Install Python dependencies
run: poetry install --with=test
Expand Down

0 comments on commit 03dee85

Please sign in to comment.