Skip to content

Commit 964e8a0

Browse files
committed
Add initial gitlab-ci workflow file
1 parent 81fb2e2 commit 964e8a0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

template/.gitlab-ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Change pip's cache directory to be inside the project directory since we can
2+
# only cache local items.
3+
variables:
4+
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
5+
6+
cache:
7+
paths:
8+
- .cache/pip
9+
10+
test:
11+
stage: test
12+
image: "python:$VERSION"
13+
rules:
14+
# Run on a Merge Request to the default branch
15+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
16+
# Run on new commits to the default branch
17+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
18+
parallel:
19+
matrix:
20+
- VERSION: ['3.8', '3.9', '3.10', '3.11', '3.12']
21+
before_script:
22+
# Python info
23+
- which python
24+
- python --version
25+
# Install dependencies
26+
- python -m pip install --upgrade pip setuptools
27+
- python -m pip install --editable ".[dev]"
28+
script:
29+
# Run pytest
30+
- python -m pytest -v --durations=0

0 commit comments

Comments
 (0)