Add GitLab CI to run tests on push
This commit is contained in:
parent
bc11c516b6
commit
f8a1cf6730
1 changed files with 25 additions and 0 deletions
25
.gitlab-ci.yml
Normal file
25
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
stages:
|
||||
- test
|
||||
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .cache/pip
|
||||
- .venv/
|
||||
|
||||
test:
|
||||
stage: test
|
||||
image: python:3.11
|
||||
before_script:
|
||||
- python -m venv .venv
|
||||
- source .venv/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install pytest pytest-asyncio aiofiles aiohttp
|
||||
script:
|
||||
- source .venv/bin/activate
|
||||
- pytest tests/ -v --tb=short
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "push"
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
Loading…
Add table
Add a link
Reference in a new issue