|
| 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 | + cypress-run: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + # Only test on Google Chrome |
| 15 | + container: cypress/browsers:node12.18.3-chrome87-ff82 |
| 16 | + steps: |
| 17 | + - 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') }} |
| 25 | + - name: Setup node |
| 26 | + uses: actions/setup-node@v2 |
| 27 | + with: |
| 28 | + node-version: '14.x' |
| 29 | + - name: Grep beta version of Meilisearch |
| 30 | + run: echo "MEILISEARCH_IMAGE=$(sh .github/scripts/beta-docker-version.sh)" >> $GITHUB_ENV |
| 31 | + - name: Try version script |
| 32 | + run: sh .github/scripts/beta-docker-version.sh |
| 33 | + - name: Meilisearch (${{ env.MEILISEARCH_IMAGE }}) setup with Docker |
| 34 | + run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_IMAGE }} meilisearch --master-key=masterKey --no-analytics |
| 35 | + - name: Install dependencies |
| 36 | + run: yarn --dev && yarn --cwd ./tests/env/react |
| 37 | + - name: Setup Meilisearch Index |
| 38 | + run: yarn local:env:setup |
| 39 | + - name: Run local browser tests |
| 40 | + uses: cypress-io/github-action@v2 |
| 41 | + with: |
| 42 | + # Tests are only done on one playground to avoid long testing time |
| 43 | + start: yarn local:env:react |
| 44 | + env: playground=local |
| 45 | + - uses: actions/upload-artifact@v2 |
| 46 | + if: failure() |
| 47 | + with: |
| 48 | + name: cypress-screenshots |
| 49 | + path: cypress/screenshots |
| 50 | + - uses: actions/upload-artifact@v2 |
| 51 | + if: failure() |
| 52 | + with: |
| 53 | + name: cypress-videos |
| 54 | + path: cypress/videos |
| 55 | + |
| 56 | + tests: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + node: ['12', '14', '16'] |
| 62 | + name: integration-tests (Node.js ${{ matrix.node }}) |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + - name: Cache dependencies |
| 66 | + uses: actions/cache@v2 |
| 67 | + with: |
| 68 | + path: | |
| 69 | + ./node_modules |
| 70 | + key: ${{ hashFiles('yarn.lock') }} |
| 71 | + - name: Get the latest Meilisearch RC |
| 72 | + run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV |
| 73 | + - name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker |
| 74 | + run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics |
| 75 | + - name: Install dependencies |
| 76 | + run: yarn install |
| 77 | + - name: Run tests |
| 78 | + run: yarn test |
| 79 | + - name: Build project |
| 80 | + run: yarn build |
0 commit comments