From 7601d452b564bdc98ed8558839c3fefca1a6604f Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Sat, 23 Oct 2021 19:19:49 -0400 Subject: [PATCH] Pin and test Poetry version br3ndonland/fastenv#6 br3ndonland/inboard#44 --- .github/workflows/ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 660c167..e52cc2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,8 @@ jobs: python-version: [3.9] env: CODECOV_UPLOAD: false - POETRY_VIRTUALENVS_CREATE: false + PIPX_VERSION: "0.16.4" + POETRY_VERSION: "1.1.11" PYPI_PUBLISH: false steps: - uses: actions/checkout@v2 @@ -37,18 +38,25 @@ jobs: path: ~/.cache/pre-commit key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} restore-keys: ${{ runner.os }}-pre-commit- + - name: Install pipx for Python ${{ matrix.python-version }} + run: python -m pip install "pipx==$PIPX_VERSION" - name: Install Poetry + run: pipx install "poetry==$POETRY_VERSION" + - name: Test Poetry version run: | - curl -fsS -o get-poetry.py \ - https://raw.githubusercontent.com/python-poetry/poetry/HEAD/get-poetry.py - python get-poetry.py -y - echo "$HOME/.poetry/bin" >> $GITHUB_PATH + POETRY_VERSION_INSTALLED=$(poetry -V) + echo "The POETRY_VERSION environment variable is set to $POETRY_VERSION." + echo "The installed Poetry version is $POETRY_VERSION_INSTALLED." + case $POETRY_VERSION_INSTALLED in + *$POETRY_VERSION*) echo "Poetry version correct." ;; + *) echo "Poetry version incorrect." && exit 1 ;; + esac - name: Install dependencies run: poetry install --no-interaction - name: Run pre-commit hooks - run: pre-commit run --all-files + run: poetry run pre-commit run --all-files - name: Run unit tests - run: pytest --cov-report=xml + run: poetry run pytest --cov-report=xml - name: Upload test coverage report to Codecov uses: codecov/codecov-action@v2 if: env.CODECOV_UPLOAD == 'true'