diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e62d8e7..7588e9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,12 +25,10 @@ jobs: with: python-version: '3.12' - - name: Cache Poetry and Virtual Environment + - name: Cache dependencies uses: actions/cache@v3 with: - path: | - ~/.poetry - .venv + path: .venv key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} restore-keys: | poetry-${{ runner.os }}- @@ -40,20 +38,14 @@ jobs: curl -sSL https://install.python-poetry.org | python3 - echo "$HOME/.poetry/bin" >> $GITHUB_PATH + - name: Configure Poetry to use in-project virtualenv + run: | + poetry config virtualenvs.in-project true + - name: Install dependencies with Poetry run: | poetry install --sync --no-interaction - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: | - ~/.poetry - .venv - key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - poetry-${{ runner.os }}- - check-formatting: runs-on: ubuntu-latest needs: setup-environment # Waits for setup-environment to finish @@ -67,21 +59,23 @@ jobs: with: python-version: '3.12' - - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - - - name: Restore cached Poetry and Virtual Environment + - name: Cache dependencies uses: actions/cache@v3 with: - path: | - ~/.poetry - .venv + path: .venv key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} restore-keys: | poetry-${{ runner.os }}- + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.poetry/bin" >> $GITHUB_PATH + + - name: Configure Poetry to use in-project virtualenv + run: | + poetry config virtualenvs.in-project true + - name: Check code formatting with Black run: | poetry run black --check . @@ -109,21 +103,23 @@ jobs: with: python-version: '3.12' - - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - - - name: Restore cached Poetry and Virtual Environment + - name: Cache dependencies uses: actions/cache@v3 with: - path: | - ~/.poetry - .venv + path: .venv key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} restore-keys: | poetry-${{ runner.os }}- + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.poetry/bin" >> $GITHUB_PATH + + - name: Configure Poetry to use in-project virtualenv + run: | + poetry config virtualenvs.in-project true + - name: Run tests with pytest run: | - poetry run pytest --maxfail=1 --disable-warnings -q + poetry run pytest --maxfail=1 --disable-warnings -q \ No newline at end of file