Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moy2010/meilisearch-github-action
Meilisearch in GitHub Actions
https://github.com/moy2010/meilisearch-github-action
Last synced: 28 days ago
JSON representation
Meilisearch in GitHub Actions
- Host: GitHub
- URL: https://github.com/moy2010/meilisearch-github-action
- Owner: moy2010
- License: mit
- Created: 2022-03-05T15:04:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-17T16:35:22.000Z (over 2 years ago)
- Last Synced: 2024-10-08T09:34:36.003Z (2 months ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 4
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-meilisearch - Meilisearch GitHub Action - Start a Meilisearch server from your GH Actions with this action (Tools / Community Tools)
README
## Introduction
This GitHub Action starts a Meilisearch server. By default, the Meilisearch server is available on the default port `7700`. You can configure a custom port using the `meilisearch-port` input. The examples show how to use a custom port.The Meilisearch version must be specified using the `meilisearch-version` input. The used version must exist in the published [`meilisearch` Docker hub tags](https://hub.docker.com/r/getmeili/meilisearch/tags). Default value is `latest`.
This is useful when running tests against a Meilisearch database.
## Usage
Here’s an exemplary GitHub Action using a Meilisearch server in version `25.2` to test a Node.js app:```yaml
name: Run testson: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]steps:
- name: Git checkout
uses: actions/checkout@v2- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}- name: Start Meilisearch
uses: moy2010/[email protected]
with:
meilisearch-version: v0.25.2- run: npm install
- run: npm test
env:
CI: true
```### Using a Custom Meilisearch Port
You can start the Meilisearch instance on a custom port. Use the `meilisearch-port: 12345` input to configure port `12345` for Meilisearch. Replace `12345` with the port you want to use in your test runs.The following example starts a Meilisearch server on port `42069`:
```yaml
name: Run testson: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]steps:
- name: Git checkout
uses: actions/checkout@v2- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}- name: Start Meilisearch
uses: moy2010/[email protected]
with:
meilisearch-version: v0.25.2
meilisearch-port: 42069- name: Install dependencies
run: npm install- name: Run tests
run: npm test
env:
CI: true
```### Using a Custom Meilisearch API Key
You can also provide a custom API to the Meilisearch instance.```yaml
name: Run testson: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]steps:
- name: Git checkout
uses: actions/checkout@v2- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}- name: Start Meilisearch
uses: moy2010/[email protected]
with:
meilisearch-version: v0.25.2
meilisearch-port: 42069
meilisearch-api-key: test-api-key- name: Install dependencies
run: npm install- name: Run tests
run: npm test
env:
CI: true
```## License
MIT © [Moises Garcia](https://github.com/moy2010)