diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5db1ec04..f94e4ac4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: path: | ~/.cache/pypoetry .venv - ${{ runner.os == 'windows-latest' && 'C:\\opt\\poetry' || '/opt/poetry' }} + ${{ runner.os == 'windows-latest' && 'C:\\opt\\poetry' || (runner.os == 'macos-latest' && '$HOME/.poetry') || '/opt/poetry' }} key: ${{ matrix.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/pyproject.toml') }} @@ -89,6 +89,11 @@ jobs: python -m venv %POETRY_HOME% %POETRY_HOME%\Scripts\pip install poetry==1.8.2 %POETRY_HOME%\Scripts\poetry --version + elif [ $RUNNER_OS = 'macOS' ]; then + export POETRY_HOME=$HOME/.poetry + python3 -m venv $POETRY_HOME + $POETRY_HOME/bin/pip install poetry==1.8.2 + $POETRY_HOME/bin/poetry --version else export POETRY_HOME=/opt/poetry python3 -m venv $POETRY_HOME @@ -100,6 +105,8 @@ jobs: run: | if [ $RUNNER_OS = 'Windows' ]; then echo "C:\\opt\\poetry\\Scripts" >> $GITHUB_PATH + elif [ $RUNNER_OS = 'macOS' ]; then + echo "$HOME/.poetry/bin" >> $GITHUB_PATH else echo "/opt/poetry/bin" >> $GITHUB_PATH fi