Skip to content

Support the MS Teams Tab App (#1942) #428

Support the MS Teams Tab App (#1942)

Support the MS Teams Tab App (#1942) #428

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- master
defaults:
run:
shell: bash
env:
TERM: xterm
GO_VERSION: 1.22.6
jobs:
lint:
runs-on: ubuntu-latest-4-cores
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: "0"
- name: ci/setup-go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: "${{ env.GO_VERSION }}"
cache: true
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: |
webapp/package-lock.json
e2e-tests/package-lock.json
- name: ci/cache-node-modules
id: cache-node-modules
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: |
webapp/node_modules
e2e-tests/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('webapp/package-lock.json') }}-${{ hashFiles('e2e-tests/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules-${{ hashFiles('webapp/package-lock.json') }}-${{ hashFiles('e2e-tests/package-lock.json') }}
- name: ci/setup-webapp-npm-deps
if: steps.cache-node-modules.outputs.cache-hit != 'true'
env:
NODE_ENV: development
run: |
cd webapp
npm install --ignore-scripts --no-save --legacy-peer-deps
- name: ci/setup-e2e-npm-deps
if: steps.cache-node-modules.outputs.cache-hit != 'true'
env:
NODE_ENV: development
run: |
cd e2e-tests
npm install --ignore-scripts --no-save
- name: ci/checking-code-style
run: make check-style
- name: ci/go-tidy
run: go mod tidy -v
- name: ci/check-diff-on-gomod
run: git --no-pager diff --exit-code go.mod go.sum || (echo "Please run \"go mod tidy\" and commit the changes in go.mod and go.sum." && exit 1)
- name: ci/run-make-apply
run: make apply
- name: ci/check-diff-on-generated-manifest-files
run: git --no-pager diff --exit-code *manifest.* || (echo "Please run \"make apply\" and commit the changes in the generated manifests." && exit 1)
- name: ci/run-make-i18n-extract-webapp
run: make i18n-extract-webapp
- name: ci/check-diff-on-webapp-i18n-files
run: git --no-pager diff --exit-code webapp/i18n/en.json || (echo "Please run \"make i18n-extract\" and commit the changes in webapp/i18n/en.json." && exit 1)
- name: ci/run-make-graphql
run: make graphql
- name: ci/check-diff-on-webapp-graphql-generated-files
run: git --no-pager diff --exit-code webapp/src/graphql/generated/ || (echo "Please run \"make graphql\" and commit the changes." && exit 1)
dist:
runs-on: ubuntu-22.04
needs:
- lint
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: "0"
- name: ci/setup-go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: "${{ env.GO_VERSION }}"
cache: true
- name: ci/ensure-build-on-all-platforms
run: make dist
test-MySQL57-Postgres11:
runs-on: ubuntu-22.04
needs:
- lint
services:
postgres:
image: postgres:11.13
env:
POSTGRES_USER: mmuser
POSTGRES_DB: mattermost_test
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: mostest
MYSQL_DATABASE: mattermost_test
MYSQL_USER: mmuser
MYSQL_PASSWORD: mostest
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: "0"
- name: ci/test-with-db
uses: ./.github/actions/test-with-db
test-MySQL8-Postgres15:
runs-on: ubuntu-22.04
needs:
- lint
services:
postgres:
image: postgres:15.3
env:
POSTGRES_USER: mmuser
POSTGRES_DB: mattermost_test
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: mostest
MYSQL_DATABASE: mattermost_test
MYSQL_USER: mmuser
MYSQL_PASSWORD: mostest
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: "0"
- name: ci/test-with-db
uses: ./.github/actions/test-with-db
generate-specs:
runs-on: ubuntu-22.04
outputs:
specs: ${{ steps.generate-specs.outputs.specs }}
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/generate-specs
id: generate-specs
uses: ./.github/actions/generate-specs
with:
parallelism: 3
directory: e2e-tests
search_path: tests/integration
e2e-cypress-tests:
runs-on: ubuntu-latest-8-cores
name: e2e-cypress-tests-run-${{ matrix.runId }}
needs:
- lint
- generate-specs
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate-specs.outputs.specs) }}
services:
postgres:
image: postgres:15.3
env:
POSTGRES_USER: mmuser
POSTGRES_PASSWORD: mostest
POSTGRES_DB: mattermost_test
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
minio:
image: minio/minio:RELEASE.2019-10-11T00-38-09Z
env:
MINIO_ACCESS_KEY: minioaccesskey
MINIO_SECRET_KEY: miniosecretkey
MINIO_SSE_MASTER_KEY: "my-minio-key:6368616e676520746869732070617373776f726420746f206120736563726574"
inbucket:
image: mattermost/inbucket:release-1.2.0
ports:
- 10080:10080
- 10110:10110
- 10025:10025
elasticsearch:
image: mattermost/mattermost-elasticsearch-docker:7.0.0
env:
http.host: "0.0.0.0"
http.port: 9200
http.cors.enabled: "true"
http.cors.allow-origin: "http://localhost:1358,http://127.0.0.1:1358"
http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization"
http.cors.allow-credentials: "true"
transport.host: "127.0.0.1"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
ports:
- 9200:9200
mattermost-server:
image: mattermost/mattermost-enterprise-edition:master
env:
DB_HOST: postgres
DB_PORT_NUMBER: 5432
MM_DBNAME: mattermost_test
MM_USERNAME: mmuser
MM_PASSWORD: mostest
CI_INBUCKET_HOST: inbucket
CI_INBUCKET_PORT: 10080
CI_MINIO_HOST: minio
IS_CI: true
MM_CLUSTERSETTINGS_READONLYCONFIG: false
MM_EMAILSETTINGS_SMTPSERVER: inbucket
MM_EMAILSETTINGS_SMTPPORT: 10025
MM_ELASTICSEARCHSETTINGS_CONNECTIONURL: http://elasticsearch:9200
MM_EXPERIMENTALSETTINGS_USENEWSAMLLIBRARY: true
MM_SQLSETTINGS_DATASOURCE: "postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10"
MM_SQLSETTINGS_DRIVERNAME: postgres
MM_PLUGINSETTINGS_ENABLEUPLOADS: true
MM_SERVICESETTINGS_SITEURL: http://localhost:8065
MM_PLUGINSETTINGS_AUTOMATICPREPACKAGEDPLUGINS: true
MM_ANNOUNCEMENTSETTINGS_ADMINNOTICESENABLED: false
MM_SERVICESETTINGS_ENABLELEGACYSIDEBAR: true
MM_TEAMSETTINGS_MAXUSERSPERTEAM: 10000
MM_SERVICESETTINGS_ENABLEONBOARDINGFLOW: false
MM_SERVICEENVIRONMENT: test
ports:
- 8065:8065
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: "0"
- name: ci/e2e-test
uses: ./.github/actions/e2e-test
with:
CYPRESS_serverEdition: E20
SPECS: ${{ matrix.specs }}
report-test-results:
if: always()
needs:
- e2e-cypress-tests
- test-MySQL57-Postgres11
- test-MySQL8-Postgres15
runs-on: ubuntu-22.04
permissions:
checks: write
pull-requests: write
steps:
- name: ci/download-test-results
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- name: ci/publish-results
uses: mikepenz/action-junit-report@c0e4b81aaa0067314a2d0d06e19b512c9d8af4f5 # v3.7.7
with:
report_paths: "**/*.xml"