Skip to content

Merge branch 'bump-meilisearch-v1.3.0' into prototype-beta/prototype-… #20

Merge branch 'bump-meilisearch-v1.3.0' into prototype-beta/prototype-…

Merge branch 'bump-meilisearch-v1.3.0' into prototype-beta/prototype-… #20

# Testing the code base against a specific Meilisearch feature
name: Meilisearch prototype tests
# Will only run for PRs and pushes to *-beta
on:
pull_request:
branches:
- 'prototype-beta/**'
push:
branches:
- 'prototype-beta/**'
jobs:
meilisearch-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.grep-step.outputs.meilisearch_version }}
steps:
- uses: actions/checkout@v3
- name: Grep docker beta version of Meilisearch
id: grep-step
run: |
MEILISEARCH_VERSION=$(sh .github/scripts/prototype-docker-version.sh $GITHUB_REF_NAME)
if [ -z "$MEILISEARCH_VERSION" ]
then
echo "Could not find any docker image for this prototype: $GITHUB_REF_NAME"
exit 1
else
echo $MEILISEARCH_VERSION
fi
echo "meilisearch_version=$MEILISEARCH_VERSION" >> $GITHUB_OUTPUT
cypress-autocomplete-client-run:
runs-on: ubuntu-latest
needs: ['meilisearch-version']
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
ports:
- '7700:7700'
name: autocomplete-client end-to-end-tests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn
- name: Run local browser tests
uses: cypress-io/github-action@v5
with:
project: ./playgrounds/autocomplete
wait-on: 'http://localhost:7700'
# Tests are only done on one playground to avoid long testing time
start: yarn playground:autocomplete
env: playground=local
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-videos
path: cypress/videos
cypress-instant-meilisearch-run:
runs-on: ubuntu-latest
needs: ['meilisearch-version']
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
ports:
- '7700:7700'
name: instant-meilisearch end-to-end-tests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn
- name: Run local browser tests
uses: cypress-io/github-action@v5
with:
project: ./playgrounds/local-react
wait-on: 'http://localhost:7700'
# Tests are only done on one playground to avoid long testing time
start: yarn playground:local-react
env: playground=local
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-videos
path: cypress/videos
integration_tests:
runs-on: ubuntu-latest
needs: ['meilisearch-version']
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
ports:
- '7700:7700'
strategy:
fail-fast: false
matrix:
node: ['14', '16', '18']
name: integration-tests (Node.js ${{ matrix.node }})
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test
- name: Build project
run: yarn build