|
9 | 9 | branches: [bump-meilisearch-v*] |
10 | 10 |
|
11 | 11 | 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 |
12 | 24 | cypress-run: |
13 | 25 | runs-on: ubuntu-latest |
14 | | - # Only test on Google Chrome |
15 | | - container: cypress/browsers:node12.18.3-chrome87-ff82 |
| 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' |
| 35 | + name: end-to-end-tests |
16 | 36 | steps: |
17 | 37 | - name: Checkout |
18 | | - uses: actions/checkout@v2 |
19 | | - - name: Cache dependencies |
20 | | - uses: actions/cache@v2 |
21 | | - with: |
22 | | - path: | |
23 | | - ./node_modules |
24 | | - key: ${{ hashFiles('yarn.lock') }} |
| 38 | + uses: actions/checkout@v3 |
25 | 39 | - name: Setup node |
26 | | - uses: actions/setup-node@v2 |
| 40 | + uses: actions/setup-node@v3 |
27 | 41 | with: |
28 | | - node-version: "14.x" |
| 42 | + node-version: 16 |
| 43 | + cache: yarn |
29 | 44 | - name: Install dependencies |
30 | 45 | run: yarn --dev && yarn --cwd ./tests/env/react |
31 | | - - name: Grep latest version of Meilisearch |
32 | | - run: | |
33 | | - echo "MEILISEARCH_LATEST=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | sh)" >> $GITHUB_ENV |
34 | | - - name: Download Meilisearch |
35 | | - run: | |
36 | | - curl https://github.com/meilisearch/meilisearch/releases/download/${{ env.MEILISEARCH_LATEST }}/meilisearch-linux-amd64 --output meilisearch --location |
37 | | - chmod +x meilisearch |
38 | | - - name: Run Meilisearch |
39 | | - run: | |
40 | | - ./meilisearch --master-key=masterKey --no-analytics & |
41 | 46 | - name: Setup Meilisearch Index |
42 | 47 | run: yarn local:env:setup |
43 | 48 | - name: Run local browser tests |
44 | 49 | uses: cypress-io/github-action@v2 |
45 | 50 | with: |
| 51 | + wait-on: 'http://localhost:7700' |
46 | 52 | # Tests are only done on one playground to avoid long testing time |
47 | 53 | start: yarn local:env:react |
48 | 54 | env: playground=local |
49 | | - - uses: actions/upload-artifact@v2 |
| 55 | + - uses: actions/upload-artifact@v3 |
50 | 56 | if: failure() |
51 | 57 | with: |
52 | 58 | name: cypress-screenshots |
53 | 59 | path: cypress/screenshots |
54 | | - - uses: actions/upload-artifact@v2 |
| 60 | + - uses: actions/upload-artifact@v3 |
55 | 61 | if: failure() |
56 | 62 | with: |
57 | 63 | name: cypress-videos |
58 | 64 | path: cypress/videos |
59 | 65 |
|
60 | | - tests: |
| 66 | + integration_tests: |
61 | 67 | runs-on: ubuntu-latest |
| 68 | + needs: ['meilisearch-version'] |
| 69 | + services: |
| 70 | + meilisearch: |
| 71 | + image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }} |
| 72 | + env: |
| 73 | + MEILI_MASTER_KEY: 'masterKey' |
| 74 | + MEILI_NO_ANALYTICS: 'true' |
| 75 | + ports: |
| 76 | + - '7700:7700' |
62 | 77 | strategy: |
63 | 78 | fail-fast: false |
64 | 79 | matrix: |
65 | | - node: ["12", "14", "16"] |
| 80 | + node: ['14', '16', '18'] |
66 | 81 | name: integration-tests (Node.js ${{ matrix.node }}) |
67 | 82 | steps: |
68 | | - - uses: actions/checkout@v2 |
69 | | - - name: Cache dependencies |
70 | | - uses: actions/cache@v2 |
| 83 | + - uses: actions/checkout@v3 |
| 84 | + - name: Setup node |
| 85 | + uses: actions/setup-node@v3 |
71 | 86 | with: |
72 | | - path: | |
73 | | - ./node_modules |
74 | | - key: ${{ hashFiles('yarn.lock') }} |
75 | | - - name: Get the latest Meilisearch RC |
76 | | - run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV |
77 | | - - name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker |
78 | | - run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics |
| 87 | + cache: yarn |
| 88 | + node-version: ${{ matrix.node }} |
79 | 89 | - name: Install dependencies |
80 | 90 | run: yarn install |
81 | 91 | - name: Run tests |
82 | 92 | run: yarn test |
83 | 93 | - name: Build project |
84 | 94 | run: yarn build |
85 | | - |
86 | | - style: |
87 | | - name: style-check |
88 | | - runs-on: ubuntu-latest |
89 | | - |
90 | | - steps: |
91 | | - - uses: actions/checkout@v2 |
92 | | - - name: Cache dependencies |
93 | | - uses: actions/cache@v2 |
94 | | - with: |
95 | | - path: | |
96 | | - ./node_modules |
97 | | - key: ${{ hashFiles('yarn.lock') }} |
98 | | - - name: Install dependencies |
99 | | - run: yarn install |
100 | | - - name: Tests style |
101 | | - run: yarn lint |
102 | | - - name: Yaml Style |
103 | | - uses: ibiqlik/action-yamllint@v3 |
104 | | - with: |
105 | | - config_file: .yamllint.yml |
106 | | - types_test: |
107 | | - runs-on: ubuntu-latest |
108 | | - name: types-check |
109 | | - steps: |
110 | | - - uses: actions/checkout@v2 |
111 | | - - name: Cache dependencies |
112 | | - uses: actions/cache@v2 |
113 | | - with: |
114 | | - path: | |
115 | | - ./node_modules |
116 | | - key: ${{ hashFiles('yarn.lock') }} |
117 | | - - name: Setup node |
118 | | - uses: actions/setup-node@v2 |
119 | | - - name: Install dependencies |
120 | | - run: yarn --dev |
121 | | - - name: Build project |
122 | | - run: yarn build |
123 | | - - name: Run types check |
124 | | - run: yarn types |
0 commit comments