mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-11 17:18:30 +02:00
* Add weekly Saturday morning build and prevent Python 3.11 from running on PRs * Fix extraneous greater than symbol * Add branches and paths to cron schedule * Add back missing hyphen before cron * Trying to fix YAML syntax error * Remove branches and paths from schedule * Fix invalid conditional, push 3.11 check down to actual tests like we did with 3.10 * Separate out PR tests and scheduled tests * Fix YAML syntax * Fix uses action reference * Use proper action folder structure * Check out repo before running local action * Specify bash shell and remove unneeded if * Specify shell for each run statement * Move secret out of composite action since it is not supported directly * Fix half-fixed previous commit * Remove extraneous ./ * Fix pathing and name steps * take out shell key from action * put back missing git config line in workflows Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
name: run jrnl tests
|
|
description: Runs all jrnl tests on multiple platforms
|
|
inputs:
|
|
cache-string:
|
|
description: 'Cache string secret. Change to bust the cache'
|
|
required: true
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- run: git config --global core.autocrlf false
|
|
shell: bash
|
|
|
|
- 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
|
|
shell: bash
|
|
|
|
- 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 }}-${{ inputs.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
|
|
shell: bash
|
|
|
|
- name: Code formatting (Black)
|
|
if: ${{ env.DEPS_INSTALLED == 'true' }}
|
|
run: |
|
|
poetry run black --version
|
|
poetry run black --check --diff .
|
|
shell: bash
|
|
|
|
- name: Code Style (flake8)
|
|
if: >
|
|
${{ env.DEPS_INSTALLED == 'true' }}
|
|
run: |
|
|
poetry run pflake8 --version
|
|
poetry run pflake8 jrnl tests
|
|
shell: bash
|
|
|
|
- name: Test with pytest
|
|
if: >
|
|
${{ env.DEPS_INSTALLED == 'true' }}
|
|
run: poetry run pytest --junitxml=reports/pytest/results.xml
|
|
shell: bash
|