mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
ci: auto-build missing buildenv images for in-flight Go version bumps (#37286)
This commit is contained in:
@@ -56,19 +56,22 @@ jobs:
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Checkout mattermost project
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Setup BUILD_IMAGE
|
||||
id: build
|
||||
- name: buildenv/load
|
||||
id: buildenv
|
||||
uses: ./.github/actions/load-buildenv
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
fips-enabled: ${{ inputs.fips-enabled }}
|
||||
- name: Setup log artifact name
|
||||
id: log-artifact
|
||||
run: |
|
||||
if [[ "$INPUT_FIPS_ENABLED" == 'true' ]]; then
|
||||
echo "BUILD_IMAGE=mattermost/mattermost-build-server-fips:${INPUT_GO_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||
echo "LOG_ARTIFACT_NAME=${INPUT_LOGSARTIFACT}-fips" >> "${GITHUB_OUTPUT}"
|
||||
else
|
||||
echo "BUILD_IMAGE=mattermost/mattermost-build-server:${INPUT_GO_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||
echo "LOG_ARTIFACT_NAME=${INPUT_LOGSARTIFACT}" >> "${GITHUB_OUTPUT}"
|
||||
fi
|
||||
|
||||
@@ -90,7 +93,7 @@ jobs:
|
||||
|
||||
- name: Run mmctl Tests
|
||||
env:
|
||||
BUILD_IMAGE: ${{ steps.build.outputs.BUILD_IMAGE }}
|
||||
BUILD_IMAGE: ${{ steps.buildenv.outputs.image }}
|
||||
run: |
|
||||
if [[ "$REF_NAME" == 'master' ]]; then
|
||||
export TESTFLAGS="-timeout 90m -race"
|
||||
@@ -120,13 +123,13 @@ jobs:
|
||||
with:
|
||||
report-path: server/report.xml
|
||||
zephyr-api-key: ${{ secrets.MM_E2E_ZEPHYR_API_KEY }}
|
||||
build-image: ${{ steps.build.outputs.BUILD_IMAGE }}
|
||||
build-image: ${{ steps.buildenv.outputs.image }}
|
||||
|
||||
- name: Archive logs
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ steps.build.outputs.LOG_ARTIFACT_NAME }}
|
||||
name: ${{ steps.log-artifact.outputs.LOG_ARTIFACT_NAME }}
|
||||
path: |
|
||||
server/gotestsum.json
|
||||
server/report.xml
|
||||
|
||||
@@ -21,8 +21,8 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
go:
|
||||
name: Compute Go Version
|
||||
buildenv:
|
||||
name: Build Environment
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.calculate.outputs.GO_VERSION }}
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
|
||||
test-race:
|
||||
name: Race Detector
|
||||
needs: go
|
||||
needs: buildenv
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
|
||||
drivername: postgres
|
||||
logsartifact: race-detector-server-test-logs
|
||||
go-version: ${{ needs.go.outputs.version }}
|
||||
go-version: ${{ needs.buildenv.outputs.version }}
|
||||
fips-enabled: false
|
||||
fullyparallel: false
|
||||
race-enabled: true
|
||||
|
||||
@@ -15,15 +15,15 @@ on:
|
||||
- cron: "0 5 * * 1" # Monday 5am UTC (~1am ET)
|
||||
push:
|
||||
branches:
|
||||
- 'release-*'
|
||||
- "release-*"
|
||||
workflow_dispatch: # Allow manual trigger for urgent FIPS/binary verification
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
go:
|
||||
name: Compute Go Version
|
||||
buildenv:
|
||||
name: Build Environment
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.calculate.outputs.GO_VERSION }}
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
test-postgres-binary:
|
||||
name: Postgres with binary parameters
|
||||
needs: go
|
||||
needs: buildenv
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
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 }}
|
||||
go-version: ${{ needs.buildenv.outputs.version }}
|
||||
fips-enabled: false
|
||||
# Unsharded run on a single 8-core runner: fullyparallel=true causes
|
||||
# resource exhaustion (too many server instances, WebSocket hubs, and
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
|
||||
test-postgres-normal-fips:
|
||||
name: Postgres FIPS
|
||||
needs: go
|
||||
needs: buildenv
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
@@ -71,14 +71,14 @@ jobs:
|
||||
datasource: postgres://mmuser:mostest-fips-test@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
|
||||
drivername: postgres
|
||||
logsartifact: postgres-server-fips-test-logs
|
||||
go-version: ${{ needs.go.outputs.version }}
|
||||
go-version: ${{ needs.buildenv.outputs.version }}
|
||||
fips-enabled: true
|
||||
# Unsharded run on a single 8-core runner: see note on test-postgres-binary.
|
||||
fullyparallel: false
|
||||
|
||||
test-mmctl-fips:
|
||||
name: Run mmctl tests (FIPS)
|
||||
needs: go
|
||||
needs: buildenv
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
@@ -92,5 +92,5 @@ jobs:
|
||||
datasource: postgres://mmuser:mostest-fips-test@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10
|
||||
drivername: postgres
|
||||
logsartifact: mmctl-fips-test-logs
|
||||
go-version: ${{ needs.go.outputs.version }}
|
||||
go-version: ${{ needs.buildenv.outputs.version }}
|
||||
fips-enabled: true
|
||||
|
||||
+79
-114
@@ -17,8 +17,6 @@ on:
|
||||
- ".github/workflows/server-test-template.yml"
|
||||
- ".github/workflows/server-test-merge-template.yml"
|
||||
- ".github/workflows/mmctl-test-template.yml"
|
||||
- "!server/build/Dockerfile.buildenv"
|
||||
- "!server/build/Dockerfile.buildenv-fips"
|
||||
- "tools/mattermost-govet/**"
|
||||
- "!server/**/*.md"
|
||||
- "!server/NOTICE.txt"
|
||||
@@ -38,12 +36,14 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
actions: write
|
||||
id-token: write # for chainguard (FIPS base image pull)
|
||||
outputs:
|
||||
version: ${{ steps.calculate.outputs.GO_VERSION }}
|
||||
gomod-changed: ${{ steps.changed-files.outputs.any_changed }}
|
||||
steps:
|
||||
- name: Checkout mattermost project
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Calculate version
|
||||
@@ -52,28 +52,32 @@ jobs:
|
||||
run: echo GO_VERSION=$(cat .go-version) >> "${GITHUB_OUTPUT}"
|
||||
- name: Check for go.mod changes
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
|
||||
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
|
||||
with:
|
||||
files: |
|
||||
**/go.mod
|
||||
- name: Setup build environment
|
||||
env:
|
||||
CHAINCTL_IDENTITY: ee399b4c72dd4e58e3d617f78fc47b74733c9557/922f2d48307d6f5f
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
uses: ./.github/actions/setup-buildenv
|
||||
with:
|
||||
go-version: ${{ steps.calculate.outputs.GO_VERSION }}
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Generate mocks
|
||||
run: make mocks
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: make mocks
|
||||
- name: Check mocks
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the mocks using 'make mocks'"
|
||||
git diff
|
||||
@@ -83,20 +87,16 @@ jobs:
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run go mod tidy
|
||||
run: make modules-tidy
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: make modules-tidy
|
||||
- name: Check modules
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please tidy up the Go modules using make modules-tidy"
|
||||
git diff
|
||||
@@ -106,35 +106,28 @@ jobs:
|
||||
name: check-style
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run golangci
|
||||
run: make check-style
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run make-gen-serialized
|
||||
run: make gen-serialized
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: make gen-serialized
|
||||
- name: Check serialized
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the serialized files using 'make gen-serialized'"
|
||||
git diff
|
||||
@@ -144,35 +137,28 @@ jobs:
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run mattermost-vet-api
|
||||
run: make vet-api
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Extract migrations files
|
||||
run: make migrations-extract
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: make migrations-extract
|
||||
- name: Check migration files
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the migrations using make migrations-extract"
|
||||
git diff
|
||||
@@ -183,33 +169,29 @@ jobs:
|
||||
# migrations they add must keep the exact version+name they have on
|
||||
# master. New migrations on master-targeted PRs are normal and skipped.
|
||||
if: startsWith(github.base_ref, 'release-')
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
git fetch --no-tags --depth=1 origin master "$GITHUB_BASE_REF"
|
||||
make check-migration-changes
|
||||
env:
|
||||
MM_MIGRATION_CHECK_BASE_REF: origin/${{ github.base_ref }}
|
||||
MM_MIGRATION_CHECK_CANONICAL_REF: origin/master
|
||||
uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: |
|
||||
git fetch --no-tags --depth=1 origin master "${{ github.base_ref }}"
|
||||
export MM_MIGRATION_CHECK_BASE_REF="origin/${{ github.base_ref }}"
|
||||
export MM_MIGRATION_CHECK_CANONICAL_REF="origin/master"
|
||||
make check-migration-changes
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Generate email templates
|
||||
run: |
|
||||
npm install -g mjml@4.9.0
|
||||
make build-templates
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: |
|
||||
npm install -g mjml@4.9.0
|
||||
make build-templates
|
||||
- name: Check generated email templates
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the email templates using 'make build-templates'"
|
||||
git diff
|
||||
@@ -219,20 +201,16 @@ jobs:
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Generate store layers
|
||||
run: make store-layers
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: make store-layers
|
||||
- name: Check generated code
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the store layers using make store-layers"
|
||||
git diff
|
||||
@@ -242,7 +220,6 @@ jobs:
|
||||
name: Check default roles permissions
|
||||
needs: go
|
||||
runs-on: ubuntu-22.04
|
||||
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
|
||||
permissions:
|
||||
contents: read
|
||||
services:
|
||||
@@ -251,26 +228,27 @@ jobs:
|
||||
env:
|
||||
POSTGRES_USER: mmuser
|
||||
POSTGRES_PASSWORD: mostest
|
||||
POSTGRES_DB: mattermost_test
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
defaults:
|
||||
run:
|
||||
working-directory: server
|
||||
steps:
|
||||
- name: Checkout mattermost project
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Generate default roles permissions
|
||||
env:
|
||||
IS_CI: "true"
|
||||
run: make default-roles-permissions
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: |
|
||||
export IS_CI=true
|
||||
export TEST_DATABASE_POSTGRESQL_DSN="postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10"
|
||||
make default-roles-permissions
|
||||
- name: Check generated code
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the default roles permissions using make default-roles-permissions"
|
||||
git diff
|
||||
@@ -280,20 +258,16 @@ jobs:
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: make mmctl-docs
|
||||
- name: Check docs
|
||||
run: |
|
||||
echo "Making sure docs are updated"
|
||||
make mmctl-docs
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please update the mmctl docs using make mmctl-docs"
|
||||
git diff
|
||||
@@ -308,7 +282,7 @@ jobs:
|
||||
name: Postgres (shard ${{ matrix.shard }})
|
||||
needs: go
|
||||
strategy:
|
||||
fail-fast: false # Let all shards complete so we get full test results
|
||||
fail-fast: false # Let all shards complete so we get full test results
|
||||
matrix:
|
||||
shard: [0, 1, 2, 3]
|
||||
permissions:
|
||||
@@ -458,32 +432,23 @@ jobs:
|
||||
contents: read
|
||||
actions: write
|
||||
runs-on: ubuntu-22.04
|
||||
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: server
|
||||
env:
|
||||
BUILD_NUMBER: "${GITHUB_HEAD_REF}-${GITHUB_RUN_ID}"
|
||||
FIPS_ENABLED: false
|
||||
steps:
|
||||
- name: Checkout mattermost project
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- 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: Build
|
||||
run: |
|
||||
make config-reset
|
||||
make build-cmd
|
||||
make package
|
||||
uses: ./.github/actions/run-in-buildenv
|
||||
with:
|
||||
run: |
|
||||
export BUILD_NUMBER="$(printf '%s' "${HEAD_REF:-${REF_NAME}}" | tr -c 'A-Za-z0-9._-' '-')-${RUN_ID}"
|
||||
export FIPS_ENABLED=false
|
||||
make config-reset
|
||||
make build-cmd
|
||||
make package
|
||||
- name: Persist dist artifacts
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: server-dist-artifact
|
||||
path: server/dist/
|
||||
@@ -492,7 +457,7 @@ jobs:
|
||||
retention-days: 2
|
||||
- name: Persist build artifacts
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: server-build-artifact
|
||||
path: server/build/
|
||||
|
||||
@@ -76,7 +76,7 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
actions: read # for load-buildenv artifact listing
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -110,6 +110,12 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: buildenv/load
|
||||
id: buildenv
|
||||
uses: ./.github/actions/load-buildenv
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
fips-enabled: ${{ inputs.fips-enabled }}
|
||||
|
||||
- name: Restore test timing data
|
||||
if: inputs.shard-total > 1
|
||||
@@ -131,14 +137,12 @@ jobs:
|
||||
restore-keys: |
|
||||
server-test-timing-v2-
|
||||
|
||||
- name: Setup BUILD_IMAGE
|
||||
id: build
|
||||
- name: Setup log artifact name
|
||||
id: log-artifact
|
||||
run: |
|
||||
if [[ "$INPUT_FIPS_ENABLED" == 'true' ]]; then
|
||||
echo "BUILD_IMAGE=mattermost/mattermost-build-server-fips:${INPUT_GO_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||
echo "LOG_ARTIFACT_NAME=${INPUT_LOGSARTIFACT}-fips" >> "${GITHUB_OUTPUT}"
|
||||
else
|
||||
echo "BUILD_IMAGE=mattermost/mattermost-build-server:${INPUT_GO_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||
echo "LOG_ARTIFACT_NAME=${INPUT_LOGSARTIFACT}" >> "${GITHUB_OUTPUT}"
|
||||
fi
|
||||
|
||||
@@ -225,7 +229,7 @@ jobs:
|
||||
|
||||
- name: Run Tests
|
||||
env:
|
||||
BUILD_IMAGE: ${{ steps.build.outputs.BUILD_IMAGE }}
|
||||
BUILD_IMAGE: ${{ steps.buildenv.outputs.image }}
|
||||
run: |
|
||||
RACE_MODE=""
|
||||
if [[ "$INPUT_RACE_ENABLED" == "true" ]]; then
|
||||
@@ -279,7 +283,7 @@ jobs:
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ steps.build.outputs.LOG_ARTIFACT_NAME }}
|
||||
name: ${{ steps.log-artifact.outputs.LOG_ARTIFACT_NAME }}
|
||||
path: |
|
||||
server/gotestsum.json
|
||||
server/report.xml
|
||||
|
||||
Reference in New Issue
Block a user