-
Notifications
You must be signed in to change notification settings - Fork 101
79 lines (65 loc) · 1.86 KB
/
search-e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Enterprise Search e2e tests
env:
NODE_VERSION: "20"
on:
pull_request:
branches:
- develop
- production
- staging
paths:
- 'bin/search/**'
- 'search/**'
- 'tests/search/e2e/**'
- 'package-lock.json'
- '.github/workflows/search-e2e.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
cypress_local:
name: Cypress - Local
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
- name: Prepare source code
uses: ./.github/actions/prepare-source
- name: "Install node v${{ env.NODE_VERSION }}"
uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Set up WP environment with Elasticsearch
run: npm run search-env:start
- name: Build asset
run: npm run search-build
- name: Set up database
run: npm run cypress:setup
- name: Test
run: npm run cypress:run
- name: Make artifacts available
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-artifact
retention-days: 2
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
${{ github.workspace }}/cypress/results/
${{ github.workspace }}/tests/search/e2e/screenshots/
${{ github.workspace }}/tests/search/e2e/videos/
${{ github.workspace }}/tests/search/e2e/logs/
- name: Stop Elasticsearch
if: always()
run: docker compose down
working-directory: bin/search/es-docker