Skip to content

Commit 70680d6

Browse files
Merge #1308
1308: Add beta testing in CI r=bidoubiwa a=bidoubiwa Adds a CI that triggers the tests for the correct beta feature Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents ec6b741 + 510bf85 commit 70680d6

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
package_json_version=$(grep '"version":' package.json | cut -d ':' -f 2- | tr -d ' ' | tr -d '"' | tr -d ',')
4+
beta_feature=$(echo $package_json_version | sed -r 's/[0-9]+.[0-9]+.[0-9]+-//')
5+
beta_feature=$(echo $beta_feature | sed -r 's/-beta\.[0-9]*$//')
6+
7+
docker_image=$(curl https://hub.docker.com/v2/repositories/getmeili/meilisearch/tags | jq | grep "$beta_feature" | head -1)
8+
docker_image=$(echo $docker_image | grep '"name":' | cut -d ':' -f 2- | tr -d ' ' | tr -d '"' | tr -d ',')
9+
echo $docker_image

.github/workflows/beta-tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Testing the code base against a specific Meilisearch feature
2+
name: Beta tests
3+
4+
# Will only run for PRs and pushes to *-beta
5+
on:
6+
push:
7+
branches: ['!bump-meilisearch-v*.*.*-beta', '**-beta']
8+
pull_request:
9+
branches: ['!bump-meilisearch-v*.*.*-beta', '**-beta']
10+
11+
jobs:
12+
integration_tests:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node: ['12', '14', '16']
17+
name: integration-tests (Node.js ${{ matrix.node }})
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Cache dependencies
21+
uses: actions/cache@v2
22+
with:
23+
path: |
24+
./node_modules
25+
key: ${{ hashFiles('yarn.lock') }}
26+
- name: Setup node
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: ${{ matrix.node }}
30+
- name: Grep beta version of Meilisearch
31+
run: echo "MEILISEARCH_IMAGE=$(sh .github/scripts/beta-docker-version.sh)" >> $GITHUB_ENV
32+
- name: Meilisearch (${{ env.MEILISEARCH_IMAGE }}) setup with Docker
33+
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_IMAGE }} meilisearch --master-key=masterKey --no-analytics
34+
- name: Install dependencies
35+
run: yarn --dev
36+
- name: Run tests
37+
run: yarn test
38+
- name: Build project
39+
run: yarn build
40+
- name: Run ESM env
41+
run: yarn test:env:esm
42+
- name: Run Node.js env
43+
run: yarn test:env:nodejs
44+
- name: Run node typescript env
45+
run: yarn test:env:node-ts
46+
- name: Run Browser env
47+
run: yarn test:env:browser

0 commit comments

Comments
 (0)