|
| 1 | +# Testing the code base against the Meilisearch pre-releases |
| 2 | +name: Pre-Release Tests |
| 3 | + |
| 4 | +# Will only run for PRs and pushes to bump-meilisearch-v* |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [bump-meilisearch-v*] |
| 8 | + pull_request: |
| 9 | + branches: [bump-meilisearch-v*] |
| 10 | + |
| 11 | +jobs: |
| 12 | + tests: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + node: ["12", "14"] |
| 18 | + name: Tests (Node.js ${{ matrix.node }}) |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Setup node |
| 22 | + uses: actions/setup-node@v2 |
| 23 | + with: |
| 24 | + node-version: ${{ matrix.node }} |
| 25 | + - name: Install dependencies |
| 26 | + run: yarn install |
| 27 | + - name: Build |
| 28 | + run: yarn run build |
| 29 | + - name: Run tests |
| 30 | + run: yarn run test |
| 31 | + |
| 32 | + cypress-run: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + # Browser on which the tests are run |
| 35 | + container: cypress/browsers:node12.18.3-chrome87-ff82 |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v2 |
| 39 | + - name: Cache dependencies |
| 40 | + uses: actions/cache@v2 |
| 41 | + with: |
| 42 | + path: | |
| 43 | + ./node_modules |
| 44 | + key: ${{ hashFiles('yarn.lock') }} |
| 45 | + - name: Setup node |
| 46 | + uses: actions/setup-node@v2 |
| 47 | + with: |
| 48 | + node-version: "14.x" |
| 49 | + - name: Install dependencies |
| 50 | + run: yarn --dev && yarn --cwd ./tests/env/browser |
| 51 | + - name: Grep latest version of Meilisearch |
| 52 | + run: | |
| 53 | + echo "MEILISEARCH_LATEST=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | sh)" >> $GITHUB_ENV |
| 54 | + - name: Download Meilisearch |
| 55 | + run: | |
| 56 | + curl https://github.com/meilisearch/meilisearch/releases/download/${{ env.MEILISEARCH_LATEST }}/meilisearch-linux-amd64 --output meilisearch --location |
| 57 | + chmod +x meilisearch |
| 58 | + - name: Run Meilisearch |
| 59 | + run: | |
| 60 | + ./meilisearch --master-key=masterKey --no-analytics true & |
| 61 | + - name: Browser tests |
| 62 | + uses: cypress-io/github-action@v2 |
| 63 | + with: |
| 64 | + # Your starting script |
| 65 | + start: yarn test:browser |
| 66 | + # Creates and uploads GitHub artifacts in case of failure |
| 67 | + - uses: actions/upload-artifact@v2 |
| 68 | + if: failure() |
| 69 | + with: |
| 70 | + name: cypress-screenshots |
| 71 | + path: cypress/screenshots |
| 72 | + - uses: actions/upload-artifact@v2 |
| 73 | + if: failure() |
| 74 | + with: |
| 75 | + name: cypress-videos |
| 76 | + path: cypress/videos |
0 commit comments