From 5dbd9965693613e67f460f03e165113fef267ee4 Mon Sep 17 00:00:00 2001
From: librelois <c@elo.tf>
Date: Sun, 25 Jul 2021 23:34:37 +0200
Subject: [PATCH] ci: create

---
 .gitlab-ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..fa03e1a3d
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,67 @@
+stages:
+  - style
+  - tests
+  - quality
+  - build
+
+workflow:
+  rules:
+    - changes:
+      - node/**/*
+      - pallets/**/*
+      - runtime/**/*
+      - .gitlab-ci.yml
+      - Cargo.toml
+      - Cargo.lock
+
+.env:
+  image: paritytech/ci-linux:production
+  tags:
+    - elois-tauon
+
+rustfmt:
+  extends: .env
+  stage: style
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: $CI_MERGE_REQUEST_ID
+  script:
+    - cargo fmt -- --version
+    - cargo fmt -- --check
+
+tests:
+  extends: .env
+  rules:
+    - if: $CI_COMMIT_REF_NAME =~ /^wip*$/
+      when: manual
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: '$CI_MERGE_REQUEST_ID ||$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^release/'
+    - when: manual
+  stage: tests
+  script:
+    - cargo test
+
+clippy:
+  extends: .env
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: never
+    - if: $CI_MERGE_REQUEST_ID
+    - when: on_success
+  stage: quality
+  script:
+    - cargo clippy -- -V
+    - cargo clippy --all --tests -- -D warnings
+
+build:
+  extends: .env
+  rules:
+    - if: $CI_COMMIT_REF_NAME =~ /^wip*$/
+      when: manual
+    - if: '$CI_COMMIT_TAG || $CI_MERGE_REQUEST_ID ||$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^release/'
+    - when: manual
+  stage: build
+  script:
+    - cargo build --release
-- 
GitLab