Files
mostlymatter/.github/workflows/server-test-template.yml
dependabot[bot] 8e03c466ab Bump the github-actions-updates group with 5 updates (#30549)
Bumps the github-actions-updates group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.4.3` | `4.6.2` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.28.11` | `3.28.12` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.8` | `4.2.1` |
| [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `531f5f7d163941f0c1c04e0ff4d8bb243ac4366f` | `27ae6b33eaed7bf87272fdeb9f1c54f9facc9d99` |
| [getsentry/action-release](https://github.com/getsentry/action-release) | `3.1.0` | `3.1.1` |


Updates `actions/upload-artifact` from 4.4.3 to 4.6.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.4.3...ea165f8d65b6e75b540449e92b4886f43607fa02)

Updates `github/codeql-action` from 3.28.11 to 3.28.12
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.11...5f8171a638ada777af81d42b55959a643bb29017)

Updates `actions/download-artifact` from 4.1.8 to 4.2.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.8...95815c38cf2ff2164869cbab79da8d1f422bc89e)

Updates `tj-actions/changed-files` from 531f5f7d163941f0c1c04e0ff4d8bb243ac4366f to 27ae6b33eaed7bf87272fdeb9f1c54f9facc9d99
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](531f5f7d16...27ae6b33ea)

Updates `getsentry/action-release` from 3.1.0 to 3.1.1
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md)
- [Commits](fa247637f7...00ed2a6cc2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-updates
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  dependency-group: github-actions-updates
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 16:22:57 +02:00

81 строка
2.9 KiB
YAML

name: Server Test Template
on:
workflow_call:
inputs:
name:
required: true
type: string
datasource:
required: true
type: string
drivername:
required: true
type: string
logsartifact:
required: true
type: string
jobs:
test:
name: ${{ inputs.name }}
runs-on: ubuntu-22.04
env:
COMPOSE_PROJECT_NAME: ghactions
steps:
- name: Checkout mattermost project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Calculate Golang Version
id: go
working-directory: ./server
run: echo GO_VERSION=$(cat .go-version) >> "${GITHUB_OUTPUT}"
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ steps.go.outputs.GO_VERSION }}
cache-dependency-path: server/go.sum
- name: Store required variables for publishing results
run: |
echo "${{ inputs.name }}" > server/test-name
echo "${{ github.event.pull_request.number }}" > server/pr-number
- name: Run docker compose
run: |
cd server/build
docker compose --ansi never run --rm start_dependencies
cat ../tests/test-data.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest';
docker compose --ansi never exec -T minio sh -c 'mkdir -p /data/mattermost-test';
docker compose --ansi never ps
- name: Run Tests
env:
BUILD_IMAGE: mattermostdevelopment/mattermost-build-server:${{ steps.go.outputs.GO_VERSION }}
run: |
if [[ ${{ github.ref_name }} == 'master' ]]; then
export RACE_MODE="-race"
fi
docker run --net ghactions_mm-test \
--ulimit nofile=8096:8096 \
--env-file=server/build/dotenv/test.env \
--env MM_SQLSETTINGS_DRIVERNAME="${{ inputs.drivername }}" \
--env MM_SQLSETTINGS_DATASOURCE="${{ inputs.datasource }}" \
--env TEST_DATABASE_MYSQL_DSN="${{ inputs.datasource }}" \
--env TEST_DATABASE_POSTGRESQL_DSN="${{ inputs.datasource }}" \
-v $(go env GOCACHE):/go/cache \
-e GOCACHE=/go/cache \
-v $PWD:/mattermost \
-w /mattermost/server \
$BUILD_IMAGE \
make test-server$RACE_MODE BUILD_NUMBER=$GITHUB_HEAD_REF-$GITHUB_RUN_ID
- name: Stop docker compose
run: |
cd server/build
docker compose --ansi never stop
- name: Archive logs
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ inputs.logsartifact }}
path: |
server/gotestsum.json
server/report.xml
server/test-name
server/pr-number