# HG changeset patch
# User Cédric Krier <ced@b2ck.com>
# Date 1671698569 -3600
#      Thu Dec 22 09:42:49 2022 +0100
# Node ID 993236bc3447bf46549b0453195a16952df1bb50
# Parent  488f6280185807a5c689462e45d4043050d282d5
Add gitlab CI

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,45 @@
+workflow:
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "trigger"
+    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
+      when: never
+    - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/
+
+stages:
+  - check
+
+.check:
+  stage: check
+  rules:
+    - if: $CI_MERGE_REQUEST_ID != null
+      when: always
+  image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci
+
+check-doc:
+  extends: .check
+  image: sphinxdoc/sphinx
+  script:
+    - python -m sphinx -T -E -W -n -b html doc _build/html
+    - python -m sphinx -T -E -W -n -b linkcheck doc _build
+  rules:
+    - changes:
+        - doc/**/*
+
+check-flake8:
+  extends: .check
+  script:
+    - hg diff --rev s0 | flake8 --diff
+
+check-isort:
+  extends: .check
+  script:
+    - isort -m VERTICAL_GRID -p trytond -c `hg status --no-status --added --modified --rev s0`
+
+check-dist:
+  extends: .check
+  before_script:
+    - pip install twine
+  script:
+    - python setup.py sdist
+    - twine check dist/*