chore(deps): update pre-commit/action action to v3.0.1 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
COMMENT_BODY_IDENTIFIER: Pytest Coverage Comment | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
python-version-file: .python-version | |
- name: Load cached Poetry installation | |
id: cached-poetry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local # the path depends on the OS | |
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }} | |
- name: Install poetry | |
if: steps.cached-poetry.outputs.cache-hit != 'true' | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true # true by default | |
virtualenvs-in-project: true # false by default | |
installer-parallel: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install project | |
run: poetry install --no-interaction | |
- name: test | |
run: | | |
set -o pipefail | |
poetry run pytest | tee pytest-coverage.txt | |
- name: find comment | |
uses: peter-evans/find-comment@v3 | |
id: fc | |
with: | |
issue-number: ${{ github.event.number }} | |
body-includes: ${{ env.COMMENT_BODY_IDENTIFIER }} | |
- name: delete comment | |
if: steps.fc.outputs.comment-id != 0 | |
uses: jungwinter/comment@v1 | |
with: | |
type: delete | |
comment_id: ${{ steps.fc.outputs.comment-id }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: pytest coverage comment | |
id: pytest-coverage-comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-coverage-path: pytest-coverage.txt | |
junitxml-path: pytest.xml | |
coverage-path-prefix: . |