mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-27 05:37:15 -05:00
* chore(ci): warm node and npm caches daily; make CI jobs restore read-only Add daily scheduled workflows on master that warm two independent caches, each in its own workflow mirroring its consumers: - webapp-ci-cache-warm.yml warms the webapp node_modules cache (keyed on webapp/package-lock.json) - e2e-ci-cache-warm.yml warms the E2E ~/.npm registry cache (keyed on the cypress/playwright/api lockfiles) Webapp CI and the E2E/api CI jobs now restore these caches read-only instead of writing them, so the daily jobs keep the caches warm. The E2E ~/.npm restore is factored into a reusable restore-e2e-npm-cache composite action, and webapp-setup gains a read-only mode for the node_modules cache. * chore(ci): guard cache-warm workflows with a concurrency group * chore(ci): drop unused node-cache-dependency-path output * chore(ci): reuse webapp-setup for node_modules in e2e-tests-check
88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
---
|
|
name: E2E Tests Check
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "e2e-tests/**"
|
|
- "webapp/platform/client/**"
|
|
- "webapp/platform/eslint-plugin/**"
|
|
- "webapp/platform/types/**"
|
|
- ".github/workflows/e2e-*.yml"
|
|
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
|
|
- name: ci/restore-npm-cache
|
|
uses: ./.github/actions/restore-e2e-npm-cache
|
|
- name: ci/setup-node
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
- name: ci/npm-cache-verify
|
|
# Heal any partial/dangling entries left in the restored ~/.npm cache
|
|
# before running `npm ci`. Avoids the intermittent EEXIST/ENOENT
|
|
# failures in npm's cacache writer.
|
|
run: npm cache verify
|
|
|
|
# Set up web app subpackages and eslint plugin, restoring the warmed
|
|
# node_modules cache read-only and falling back to `make node_modules` on a
|
|
# miss.
|
|
- name: ci/webapp-setup
|
|
uses: ./.github/actions/webapp-setup
|
|
with:
|
|
read-only: "true"
|
|
|
|
# Cypress check
|
|
- name: ci/cypress/npm-install
|
|
working-directory: e2e-tests/cypress
|
|
run: npm ci
|
|
- name: ci/cypress/npm-check
|
|
working-directory: e2e-tests/cypress
|
|
run: npm run check
|
|
|
|
# Playwright check
|
|
- name: ci/playwright/npm-install
|
|
working-directory: e2e-tests/playwright
|
|
run: npm ci
|
|
- name: ci/playwright/npm-check
|
|
working-directory: e2e-tests/playwright
|
|
run: npm run check
|
|
|
|
# Shell check
|
|
- name: ci/shell-check
|
|
working-directory: e2e-tests
|
|
run: make check-shell
|
|
|
|
# E2E-only check and trigger
|
|
- name: ci/check-e2e-test-only
|
|
id: check
|
|
uses: ./.github/actions/check-e2e-test-only
|
|
with:
|
|
base_sha: ${{ github.event.pull_request.base.sha }}
|
|
head_sha: ${{ github.event.pull_request.head.sha }}
|
|
pr_number: ${{ github.event.pull_request.number }}
|
|
|
|
- name: ci/trigger-e2e-with-branch-image
|
|
if: >-
|
|
steps.check.outputs.e2e_test_only == 'true' &&
|
|
(github.event.pull_request.base.ref == 'master' || startsWith(github.event.pull_request.base.ref, 'release-'))
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
IMAGE_TAG: ${{ steps.check.outputs.image_tag }}
|
|
run: |
|
|
echo "Triggering E2E tests for PR #${PR_NUMBER} with mattermostdevelopment/mattermost-enterprise-edition:${IMAGE_TAG}"
|
|
gh workflow run e2e-tests-ci.yml --field pr_number="${PR_NUMBER}"
|