mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: run jrnl tests
|
|
description: Runs all jrnl tests on multiple platforms
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- run: git config --global core.autocrlf false
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Capture full Python version in env
|
|
run: echo "PYTHON_FULL_VERSION=$(python --version)" >> $GITHUB_ENV
|
|
|
|
- name: poetry cache # Change CACHE_STRING secret to bust the cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: .venv
|
|
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_FULL_VERSION }}-${{ secrets.CACHE_STRING }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
echo '::group::poetry'
|
|
pip --disable-pip-version-check install poetry
|
|
poetry config --local virtualenvs.in-project true
|
|
echo '::endgroup::'
|
|
|
|
echo '::group::Other dependencies'
|
|
poetry install --remove-untracked
|
|
echo '::endgroup::'
|
|
|
|
echo 'DEPS_INSTALLED=true' >> $GITHUB_ENV
|
|
|
|
- name: Code formatting (Black)
|
|
if: ${{ env.DEPS_INSTALLED == 'true' }}
|
|
run: |
|
|
poetry run black --version
|
|
poetry run black --check --diff .
|
|
|
|
- name: Code Style (flake8)
|
|
if: >
|
|
${{ env.DEPS_INSTALLED == 'true' }}
|
|
run: |
|
|
poetry run pflake8 --version
|
|
poetry run pflake8 jrnl tests
|
|
|
|
- name: Test with pytest
|
|
if: >
|
|
${{ env.DEPS_INSTALLED == 'true' }}
|
|
run: poetry run pytest --junitxml=reports/pytest/results.xml
|