-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (108 loc) · 2.92 KB
/
tests.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Tests
on:
pull_request:
push:
# trying and staging branches are for BORS config
branches:
- trying
- staging
- main
jobs:
linter_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '14.x'
cache: yarn
- name: Install dependencies
run: yarn --dev
- name: Run style check
run: yarn lint
- name: Run yaml style check
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml
tests-run:
runs-on: ubuntu-latest
strategy:
matrix:
# Gatsby >= 4 is not compatible anymore with node 12
node: ['14', '16']
name: tests-run (Node.js ${{ matrix.node }})
services:
meilisearch:
image: getmeili/meilisearch:latest
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
ports:
- '7700:7700'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: Install dependencies
run: yarn
- name: Run tests
run: yarn test
env:
MEILI_HTTP_ADDR: 'http://localhost:7700'
MEILI_MASTER_KEY: masterKey
MEILI_INDEX_NAME: my_blog
cypress_tests:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
options: --user 1001
services:
meilisearch:
image: getmeili/meilisearch:latest
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
ports:
- '7700:7700'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '14.x'
cache: yarn
cache-dependency-path: |
yarn.lock
playground/yarn.lock
- name: Install dependencies
run: yarn
- name: Install playground dependencies
run: yarn --dev && yarn --cwd ./playground
- name: Browser tests
uses: cypress-io/github-action@v4
with:
build: yarn playground:build
start: yarn playground:serve
wait-on: 'http://127.0.0.1:9000'
command: yarn cy:run
config-file: cypress.json
env:
GATSBY_MEILI_HTTP_ADDR: 'http://meilisearch:7700'
GATSBY_MEILI_MASTER_KEY: masterKey
GATSBY_MEILI_INDEX_NAME: my_blog
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos