mattermost/.github/workflows/server-ci.yml
dependabot[bot] 56953189f3
Some checks failed
API / build (push) Has been cancelled
Opensearch Docker Image / build-image (push) Has been cancelled
BuildEnv Docker Image / build-image (push) Has been cancelled
BuildEnv Docker Image / build-image-fips (push) Has been cancelled
Server CI / Compute Go Version (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Server CI / Check mocks (push) Has been cancelled
Server CI / Check go mod tidy (push) Has been cancelled
Server CI / check-style (push) Has been cancelled
Server CI / Check serialization methods for hot structs (push) Has been cancelled
Server CI / Vet API (push) Has been cancelled
Server CI / Check migration files (push) Has been cancelled
Server CI / Generate email templates (push) Has been cancelled
Server CI / Check store layers (push) Has been cancelled
Server CI / Check mmctl docs (push) Has been cancelled
Server CI / Postgres with binary parameters (push) Has been cancelled
Server CI / Postgres (push) Has been cancelled
Server CI / Postgres (FIPS) (push) Has been cancelled
Server CI / Generate Test Coverage (push) Has been cancelled
Server CI / Run mmctl tests (push) Has been cancelled
Server CI / Run mmctl tests (FIPS) (push) Has been cancelled
Server CI / Build mattermost server app (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
Bump the github-actions-updates group with 11 updates (#35500)
Bumps the github-actions-updates group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.2.2` | `6.0.2` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.2.0` | `6.3.0` |
| [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.0.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.19.2` | `7.0.0` |
| [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) | `1.0.54` | `1.0.70` |
| [github/codeql-action](https://github.com/github/codeql-action) | `4.32.3` | `4.32.6` |
| [actions/setup-go](https://github.com/actions/setup-go) | `6.2.0` | `6.3.0` |
| [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `47.0.4` | `47.0.5` |
| [getsentry/action-release](https://github.com/getsentry/action-release) | `3.1.1` | `3.5.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.12.0` | `4.0.0` |
| [mikepenz/action-junit-report](https://github.com/mikepenz/action-junit-report) | `6.2.0` | `6.3.1` |


Updates `actions/checkout` from 4.2.2 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.2...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

Updates `actions/setup-node` from 6.2.0 to 6.3.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](6044e13b5d...53b83947a5)

Updates `docker/login-action` from 3.7.0 to 4.0.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](c94ce9fb46...b45d80f862)

Updates `docker/build-push-action` from 6.19.2 to 7.0.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](10e90e3645...d08e5c354a)

Updates `anthropics/claude-code-action` from 1.0.54 to 1.0.70
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](0cf5eeec4f...26ec041249)

Updates `github/codeql-action` from 4.32.3 to 4.32.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9e907b5e64...0d579ffd05)

Updates `actions/setup-go` from 6.2.0 to 6.3.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](7a3fe6cf4c...4b73464bb3)

Updates `tj-actions/changed-files` from 47.0.4 to 47.0.5
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](7dee1b0c15...22103cc46b)

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

Updates `docker/setup-buildx-action` from 3.12.0 to 4.0.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](8d2750c68a...4d04d5d948)

Updates `mikepenz/action-junit-report` from 6.2.0 to 6.3.1
- [Release notes](https://github.com/mikepenz/action-junit-report/releases)
- [Commits](74626db735...49b2ca06f6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
- dependency-name: actions/setup-node
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: docker/login-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
- dependency-name: docker/build-push-action
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.70
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-updates
- dependency-name: github/codeql-action
  dependency-version: 4.32.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-updates
- dependency-name: actions/setup-go
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: tj-actions/changed-files
  dependency-version: 47.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-updates
- dependency-name: getsentry/action-release
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
- dependency-name: mikepenz/action-junit-report
  dependency-version: 6.3.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  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>
2026-03-07 13:36:18 +08:00

310 lines
12 KiB
YAML

# NOTE: This workflow name is referenced by other workflows:
# - server-ci-artifacts.yml
# - server-ci-report.yml
# - sentry.yaml
# If you rename this workflow, be sure to update those workflows as well.
name: Server CI
on:
push:
branches:
- master
- release-*
pull_request:
paths:
- "server/**"
- ".github/workflows/server-ci.yml"
- ".github/workflows/server-test-template.yml"
- ".github/workflows/mmctl-test-template.yml"
- "!server/build/Dockerfile.buildenv"
- "!server/build/Dockerfile.buildenv-fips"
concurrency:
group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.ref) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
go:
name: Compute Go Version
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.calculate.outputs.GO_VERSION }}
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Calculate version
id: calculate
working-directory: server/
run: echo GO_VERSION=$(cat .go-version) >> "${GITHUB_OUTPUT}"
check-mocks:
name: Check mocks
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Generate mocks
run: make mocks
- name: Check mocks
run: if [[ -n $(git status --porcelain) ]]; then echo "Please update the mocks using `make mocks`"; exit 1; fi
check-go-mod-tidy:
name: Check go mod tidy
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Run go mod tidy
run: make modules-tidy
- name: Check modules
run: if [[ -n $(git status --porcelain) ]]; then echo "Please tidy up the Go modules using make modules-tidy"; git diff; exit 1; fi
check-style:
name: check-style
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
env:
GOFLAGS: -buildvcs=false # TODO: work around "error obtaining VCS status: exit status 128" in a container
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Run golangci
run: make check-style
check-gen-serialized:
name: Check serialization methods for hot structs
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Run make-gen-serialized
run: make gen-serialized
- name: Check serialized
run: if [[ -n $(git status --porcelain) ]]; then echo "Please update the serialized files using 'make gen-serialized'"; exit 1; fi
check-mattermost-vet-api:
name: Vet API
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Run mattermost-vet-api
run: make vet-api
check-migrations:
name: Check migration files
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract migrations files
run: make migrations-extract
- name: Check migration files
run: if [[ -n $(git status --porcelain) ]]; then echo "Please update the migrations using make migrations-extract"; exit 1; fi
check-email-templates:
name: Generate email templates
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Generate email templates
run: |
npm install -g mjml@4.9.0
make build-templates
- name: Check generated email templates
run: if [[ -n $(git status --porcelain) ]]; then echo "Please update the email templates using `make build-templates`"; exit 1; fi
check-store-layers:
name: Check store layers
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Generate store layers
run: make store-layers
- name: Check generated code
run: if [[ -n $(git status --porcelain) ]]; then echo "Please update the store layers using make store-layers"; exit 1; fi
check-mmctl-docs:
name: Check mmctl docs
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
steps:
- name: Checkout mattermost-server
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run setup-go-work
run: make setup-go-work
- name: Check docs
run: |
echo "Making sure docs are updated"
make mmctl-docs
if [[ -n $(git status --porcelain) ]]; then echo "Please update the mmctl docs using make mmctl-docs"; exit 1; fi
test-postgres-binary:
if: github.event_name == 'push' # Only run postgres binary tests on master/release pushes: odds are low this regresses, so save the cycles for pull requests.
name: Postgres with binary parameters
needs: go
uses: ./.github/workflows/server-test-template.yml
secrets: inherit
with:
name: Postgres with binary parameters
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes
drivername: postgres
logsartifact: postgres-binary-server-test-logs
go-version: ${{ needs.go.outputs.version }}
fips-enabled: false
test-postgres-normal:
name: Postgres
needs: go
uses: ./.github/workflows/server-test-template.yml
secrets: inherit
with:
name: Postgres
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
drivername: postgres
logsartifact: postgres-server-test-logs
go-version: ${{ needs.go.outputs.version }}
fips-enabled: false
test-postgres-normal-fips:
# Skip FIPS testing for forks, which won't have docker login credentials.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
name: Postgres (FIPS)
needs: go
uses: ./.github/workflows/server-test-template.yml
secrets: inherit
with:
name: Postgres
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
drivername: postgres
logsartifact: postgres-server-test-logs
go-version: ${{ needs.go.outputs.version }}
fips-enabled: true
test-coverage:
name: Generate Test Coverage
# Disabled: Running out of memory and causing spurious failures.
# Old condition: ${{ github.event_name != 'pull_request' || !startsWith(github.event.pull_request.base.ref, 'release-') }}
if: false
needs: go
uses: ./.github/workflows/server-test-template.yml
secrets: inherit
with:
name: Generate Test Coverage
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
drivername: postgres
logsartifact: coverage-server-test-logs
fullyparallel: true
enablecoverage: true
go-version: ${{ needs.go.outputs.version }}
test-mmctl:
name: Run mmctl tests
needs: go
uses: ./.github/workflows/mmctl-test-template.yml
secrets: inherit
with:
name: mmctl
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
drivername: postgres
logsartifact: mmctl-test-logs
go-version: ${{ needs.go.outputs.version }}
fips-enabled: false
test-mmctl-fips:
name: Run mmctl tests (FIPS)
# Skip FIPS testing for forks, which won't have docker login credentials.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
needs: go
uses: ./.github/workflows/mmctl-test-template.yml
secrets: inherit
with:
name: mmctl
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
drivername: postgres
logsartifact: mmctl-test-logs
go-version: ${{ needs.go.outputs.version }}
fips-enabled: true
build-mattermost-server:
name: Build mattermost server app
needs: go
runs-on: ubuntu-22.04
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
defaults:
run:
working-directory: server
env:
GOFLAGS: -buildvcs=false # TODO: work around "error obtaining VCS status: exit status 128" in a container
BUILD_NUMBER: "${GITHUB_HEAD_REF}-${GITHUB_RUN_ID}"
FIPS_ENABLED: false
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: ci/setup-node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: "webapp/package-lock.json"
- name: Run setup-go-work
run: make setup-go-work
- name: Build
run: |
make config-reset
make build-cmd
make package
- name: Persist dist artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: server-dist-artifact
path: server/dist/
if-no-files-found: error
compression-level: 0
retention-days: 2
- name: Persist build artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: server-build-artifact
path: server/build/
retention-days: 2