mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
refactor: rename test -> tests
This commit is contained in:
parent
b0faddea52
commit
f3890a1668
28 changed files with 36 additions and 29 deletions
65
.github/workflows/pytest.yml
vendored
65
.github/workflows/pytest.yml
vendored
|
@ -14,36 +14,43 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v1
|
||||
#----------------------------------------------
|
||||
# check-out repo and set-up python
|
||||
#----------------------------------------------
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
python-version: 3.9
|
||||
#----------------------------------------------
|
||||
# ----- install & configure poetry -----
|
||||
#----------------------------------------------
|
||||
- name: Install Poetry
|
||||
uses: dschep/install-poetry-action@v1.2
|
||||
- name: Install Poetry
|
||||
uses: dschep/install-poetry-action@v1.2
|
||||
|
||||
- name: Cache Poetry virtualenv
|
||||
uses: actions/cache@v1
|
||||
id: cache
|
||||
uses: snok/install-poetry@v1.1.1
|
||||
with:
|
||||
path: ~/.virtualenvs
|
||||
key: poetry-${{ hashFiles('**/poetry.lock') }}
|
||||
restore-keys: |
|
||||
poetry-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- name: Set Poetry config
|
||||
run: |
|
||||
poetry config settings.virtualenvs.in-project false
|
||||
poetry config settings.virtualenvs.path ~/.virtualenvs
|
||||
|
||||
- name: Install Dependencies
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
#----------------------------------------------
|
||||
# load cached venv if cache exists
|
||||
#----------------------------------------------
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
|
||||
#----------------------------------------------
|
||||
# install dependencies if cache does not exist
|
||||
#----------------------------------------------
|
||||
- name: Install dependencies
|
||||
run: poetry install
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Code Quality
|
||||
run: poetry run black . --check
|
||||
|
||||
- name: Test with pytest
|
||||
run: poetry run pytest --cov . -n 2
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
#----------------------------------------------
|
||||
# run test suite
|
||||
#----------------------------------------------
|
||||
- name: Run tests
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
pytest mealie/tests/
|
||||
coverage report
|
||||
|
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Loading…
Add table
Add a link
Reference in a new issue