Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Enable gitlab and testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
metanerd committed Jan 14, 2021
1 parent 69386f9 commit bf52691
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .gitlab-ci.yml
@@ -0,0 +1,85 @@
stages:
- test
# These need to have separate stages, otherwise artifacts would overwrite each other
- te-build
- te-s3
- ee-build-test # rudder-rc, stripe-test
- ee-s3-test
- ee-build-live # rudder-live, stripe-live
- ee-s3-live
- ee-build-onprem-rc # rudder-rc, stripe-test
- ee-s3-onprem-rc
- ee-build-onprem # rudder-live, stripe-test
- ee-s3-onprem
- create-vars
- trigger

variables:
BUILD: "yes"
TEST: "yes"

include:
- project: mattermost/ci/mattermost-webapp
ref: release-5.29
file: private.yml
- local: .gitlab-ci/check.gitlab-ci.yml

empty:
stage: create-vars
script:
- echo "empty"

prepare:
stage: .pre
image: $CI_REGISTRY/mattermost/ci/images/mattermost-build-webapp:20200829_node-10.22
cache:
key:
files:
- package.json
prefix: ${CI_COMMIT_REF_SLUG}
paths:
- .npm/
- node_modules/
script:
- npm ci --cache .npm --prefer-offline && cd node_modules/mattermost-redux && npm i && npm run build && cd -
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^release-/ && $TEST == "yes"'

lint:
extends: .check
script:
- npm run check
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^release-/ && $TEST == "yes"'

test: #todo check on how to create junit.xml, there currently is none
extends: .check
script:
- npm run test-ci
timeout: 3 hours
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^release-/ && $TEST == "yes"'

type-check:
extends: .check
script:
- npm run check-types
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^release-/ && $TEST == "yes"'

i18n-check:
extends: .check
script:
- cp i18n/en.json /tmp/en.json
- mkdir -p /tmp/fake-mobile-dir/assets/base/i18n/
- echo '{}' > /tmp/fake-mobile-dir/assets/base/i18n/en.json

- npm run mmjstool -- i18n extract-webapp --webapp-dir . --mobile-dir /tmp/fake-mobile-dir
- diff /tmp/en.json i18n/en.json
# Address weblate behavior which does not remove whole translation item when translation string is set to empty
- npm run mmjstool -- i18n clean-empty --webapp-dir . --mobile-dir /tmp/fake-mobile-dir --check
- npm run mmjstool -- i18n check-empty-src --webapp-dir . --mobile-dir /tmp/fake-mobile-dir

- rm -rf tmp
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^release-/ && $TEST == "yes"'
12 changes: 12 additions & 0 deletions .gitlab-ci/check.gitlab-ci.yml
@@ -0,0 +1,12 @@
.check:
stage: test
image: $CI_REGISTRY/mattermost/ci/images/mattermost-build-webapp:20200829_node-10.22
cache:
key:
files:
- package.json
prefix: ${CI_COMMIT_REF_SLUG}
paths:
- .npm/
- node_modules/
policy: pull

0 comments on commit bf52691

Please sign in to comment.