Merge #251 #606
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |