Skip to content

Commit 228bae5

Browse files
Merge #1309
1309: Update CI's dependencies/consistency/ node 18 support r=bidoubiwa a=bidoubiwa Node 18 is already the default version the user gets whenever they download node. We must ensure we are compatible with this version I forced the tests on all CI's and they were successful. I put back the condition to not run it now. Proof that they work: <img width="404" alt="Screenshot 2022-07-27 at 17 17 38" src="https://user-images.githubusercontent.com/33010418/181284936-96c02f3d-e792-484c-a03d-c9d91dd44150.png"> ⚠️ TODO - [x] add test in main branch security rules in the settings - [x] wait in #1311 Updates are based on [instant-meilisearch CI's](https://github.com/meilisearch/instant-meilisearch/tree/main/.github) Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents f615f79 + 9e82f8f commit 228bae5

File tree

9 files changed

+750
-2616
lines changed

9 files changed

+750
-2616
lines changed

.github/workflows/beta-tests.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,40 @@ on:
99
branches: ['!bump-meilisearch-v*.*.*-beta', '**-beta']
1010

1111
jobs:
12+
meilisearch-version:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
version: ${{ steps.grep-step.outputs.version }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Grep docker beta version of Meilisearch
19+
id: grep-step
20+
run: |
21+
MEILISEARCH_VERSION=$(sh .github/scripts/beta-docker-version.sh)
22+
echo $MEILISEARCH_VERSION
23+
echo ::set-output name=version::$MEILISEARCH_VERSION
1224
integration_tests:
1325
runs-on: ubuntu-latest
26+
needs: ['meilisearch-version']
27+
services:
28+
meilisearch:
29+
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
30+
env:
31+
MEILI_MASTER_KEY: 'masterKey'
32+
MEILI_NO_ANALYTICS: 'true'
33+
ports:
34+
- '7700:7700'
1435
strategy:
1536
matrix:
16-
node: ['12', '14', '16']
37+
node: ['14', '16', '18']
1738
name: integration-tests (Node.js ${{ matrix.node }})
1839
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') }}
40+
- uses: actions/checkout@v3
2641
- name: Setup node
27-
uses: actions/setup-node@v2
42+
uses: actions/setup-node@v3
2843
with:
2944
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
45+
cache: yarn
3446
- name: Install dependencies
3547
run: yarn --dev
3648
- name: Run tests
Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,50 @@
11
# Testing the code base against the Meilisearch pre-releases
22
name: Pre-Release Tests
33

4-
# Will only run for PRs and pushes to bump-meilisearch-v*
4+
# # Will only run for PRs and pushes to bump-meilisearch-v*
55
on:
66
push:
77
branches: [bump-meilisearch-v*]
88
pull_request:
99
branches: [bump-meilisearch-v*]
1010

1111
jobs:
12+
meilisearch-version:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
version: ${{ steps.grep-step.outputs.version }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Grep docker beta version of Meilisearch
19+
id: grep-step
20+
run: |
21+
MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | sh)
22+
echo $MEILISEARCH_VERSION
23+
echo ::set-output name=version::$MEILISEARCH_VERSION
1224
integration_tests:
1325
runs-on: ubuntu-latest
26+
needs: ['meilisearch-version']
27+
services:
28+
meilisearch:
29+
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
30+
env:
31+
MEILI_MASTER_KEY: 'masterKey'
32+
MEILI_NO_ANALYTICS: 'true'
33+
ports:
34+
- '7700:7700'
1435
strategy:
1536
matrix:
16-
node: ["12", "14", "16"]
17-
name: integration-tests-against-rc (Node.js ${{ matrix.node }})
37+
node: ['14', '16', '18']
38+
name: integration-tests (Node.js ${{ matrix.node }})
1839
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') }}
40+
- uses: actions/checkout@v3
2641
- name: Setup node
27-
uses: actions/setup-node@v2
42+
uses: actions/setup-node@v3
2843
with:
2944
node-version: ${{ matrix.node }}
30-
- name: print version
31-
run: node -v
45+
cache: yarn
3246
- name: Install dependencies
3347
run: yarn --dev
34-
- name: Get the latest Meilisearch RC
35-
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
36-
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
37-
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
3848
- name: Run tests
3949
run: yarn test
4050
- name: Build project
@@ -47,45 +57,3 @@ jobs:
4757
run: yarn test:env:node-ts
4858
- name: Run Browser env
4959
run: yarn test:env:browser
50-
51-
linter_check:
52-
runs-on: ubuntu-latest
53-
name: linter-check
54-
steps:
55-
- uses: actions/checkout@v2
56-
- name: Cache dependencies
57-
uses: actions/cache@v2
58-
with:
59-
path: |
60-
./node_modules
61-
key: ${{ hashFiles('yarn.lock') }}
62-
- name: Setup node
63-
uses: actions/setup-node@v2
64-
- name: Install dependencies
65-
run: yarn --dev
66-
- name: Run style check
67-
run: yarn style
68-
- name: yaml-lint
69-
uses: ibiqlik/action-yamllint@v3
70-
with:
71-
config_file: .yamllint.yml
72-
73-
types_check:
74-
runs-on: ubuntu-latest
75-
name: types-check
76-
steps:
77-
- uses: actions/checkout@v2
78-
- name: Cache dependencies
79-
uses: actions/cache@v2
80-
with:
81-
path: |
82-
./node_modules
83-
key: ${{ hashFiles('yarn.lock') }}
84-
- name: Setup node
85-
uses: actions/setup-node@v2
86-
- name: Install dependencies
87-
run: yarn --dev
88-
- name: Build project
89-
run: yarn build
90-
- name: Run types check
91-
run: yarn types

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ jobs:
77
publish-npm:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-node@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
1212
with:
13-
node-version: 12
13+
node-version: 16
1414
registry-url: https://registry.npmjs.org/
15+
cache: 'yarn'
1516
- name: Check release validity
1617
run: sh .github/scripts/check-release.sh
1718
- name: Check tag format

.github/workflows/tests.yml

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,28 @@ jobs:
1515
# Will still run for each push to bump-meilisearch-v*
1616
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
1717
runs-on: ubuntu-latest
18+
services:
19+
meilisearch:
20+
image: getmeili/meilisearch:latest
21+
env:
22+
MEILI_MASTER_KEY: 'masterKey'
23+
MEILI_NO_ANALYTICS: 'true'
24+
ports:
25+
- '7700:7700'
1826
strategy:
1927
fail-fast: false
2028
matrix:
21-
node: ["12", "14", "16"]
29+
node: ['14', '16', '18']
2230
name: integration-tests (Node.js ${{ matrix.node }})
2331
steps:
24-
- uses: actions/checkout@v2
25-
- name: Cache dependencies
26-
uses: actions/cache@v2
27-
with:
28-
path: |
29-
./node_modules
30-
key: ${{ hashFiles('yarn.lock') }}
32+
- uses: actions/checkout@v3
3133
- name: Setup node
32-
uses: actions/setup-node@v2
34+
uses: actions/setup-node@v3
3335
with:
3436
node-version: ${{ matrix.node }}
35-
- name: print version
36-
run: node -v
37+
cache: 'yarn'
3738
- name: Install dependencies
3839
run: yarn --dev
39-
- name: Meilisearch (latest) setup with Docker
40-
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --no-analytics --master-key='masterKey'
4140
- name: Run tests
4241
run: yarn test
4342
- name: Build project
@@ -50,41 +49,34 @@ jobs:
5049
run: yarn test:env:node-ts
5150
- name: Run Browser env
5251
run: yarn test:env:browser
53-
linter_check:
52+
style_tests:
5453
runs-on: ubuntu-latest
55-
name: linter-check
54+
name: style-check
5655
steps:
57-
- uses: actions/checkout@v2
58-
- name: Cache dependencies
59-
uses: actions/cache@v2
60-
with:
61-
path: |
62-
./node_modules
63-
key: ${{ hashFiles('yarn.lock') }}
56+
- uses: actions/checkout@v3
6457
- name: Setup node
65-
uses: actions/setup-node@v2
58+
uses: actions/setup-node@v3
59+
with:
60+
node-version: 16
61+
cache: 'yarn'
6662
- name: Install dependencies
6763
run: yarn --dev
68-
- name: Run style check
64+
- name: Run code style check
6965
run: yarn style
70-
- name: yaml-lint
66+
- name: Run yaml style check
7167
uses: ibiqlik/action-yamllint@v3
7268
with:
7369
config_file: .yamllint.yml
74-
75-
types_check:
70+
types_tests:
7671
runs-on: ubuntu-latest
7772
name: types-check
7873
steps:
79-
- uses: actions/checkout@v2
80-
- name: Cache dependencies
81-
uses: actions/cache@v2
82-
with:
83-
path: |
84-
./node_modules
85-
key: ${{ hashFiles('yarn.lock') }}
74+
- uses: actions/checkout@v3
8675
- name: Setup node
87-
uses: actions/setup-node@v2
76+
uses: actions/setup-node@v3
77+
with:
78+
node-version: 16
79+
cache: 'yarn'
8880
- name: Install dependencies
8981
run: yarn --dev
9082
- name: Build project

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
3434

3535
To run this project, you will need:
3636

37-
- Node.js >= v12 and node <= 16
37+
- Node.js >= v14 and node <= 18
3838
- Yarn
3939

4040

@@ -151,9 +151,7 @@ Here are the steps to release a beta version of this package:
151151
git checkout -b bump-meilisearch-v*.*.*-beta
152152
```
153153

154-
- Change the version in `package.json` with `*.*.*-xxx-beta.0` and commit it to the `v*.*.*-beta` branch. None or multiple `-xxx`are valid. Examples:
155-
- `v*.*.*-my-feature-beta.0`
156-
- `v*.*.*-beta.0`
154+
- Change the version in [`package.json`](/package.json) and in [`src/package-version`](/src/package-version.ts) with `*.*.*-xxx-beta.0` and commit it to the `beta` branch.
157155

158156
- Go to the [GitHub interface for releasing](https://github.com/meilisearch/meilisearch-js/releases): on this page, click on `Draft a new release`.
159157

@@ -169,7 +167,7 @@ GitHub Actions will be triggered and push the beta version to [npm](https://www.
169167

170168
💡 If you need to release a new beta for the same version (i.e. `vX.X.X-beta.1`):
171169
- merge the change into your beta branch
172-
- change the version name in `package.json`
170+
- change the version name in [`package.json`](/package.json) and in [`src/package-version`](/src/package-version.ts)
173171
- creata a pre-release via the GitHub interface
174172

175173
<hr>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ See our [Documentation](https://docs.meilisearch.com/learn/tutorials/getting_sta
4343

4444
## 🔧 Installation
4545

46-
We only guarantee that the package works with `node` >= 12 and `node` <= 16.
46+
We only guarantee that the package works with `node` >= 14 and `node` <= 18.
4747

4848
With `npm`:
4949

bors.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
status = [
2-
'linter-check',
2+
'style-check',
33
'types-check',
4-
'integration-tests (Node.js 12)',
54
'integration-tests (Node.js 14)',
6-
'integration-tests (Node.js 16)'
5+
'integration-tests (Node.js 16)',
6+
'integration-tests (Node.js 18)',
77
]
88
# 1 hour timeout
99
timeout-sec = 3600

tests/env/esm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"author": "",
1111
"license": "ISC",
1212
"devDependencies": {
13-
"webpack": "^4.43.0",
14-
"webpack-cli": "^3.3.12"
13+
"webpack": "^5.74.0",
14+
"webpack-cli": "^4.10.0"
1515
}
1616
}

0 commit comments

Comments
 (0)