From 0cba9192283e9a50b3f5e9bb4cdf8379cc944f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20Urquizar?= Date: Fri, 28 Apr 2023 17:59:04 +0200 Subject: [PATCH] Add SDKs test in a CI --- .github/workflows/sdks-tests.yml | 200 +++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 .github/workflows/sdks-tests.yml diff --git a/.github/workflows/sdks-tests.yml b/.github/workflows/sdks-tests.yml new file mode 100644 index 000000000..617b446d1 --- /dev/null +++ b/.github/workflows/sdks-tests.yml @@ -0,0 +1,200 @@ +# If any test fails, the engine team should ensure the "breaking" changes are expected and contact the integration team +name: SDKs tests + +on: + workflow_dispatch: + schedule: + - cron: "0 6 * * MON" # Every Monday at 6:00AM + +env: + MEILI_MASTER_KEY: 'masterKey' + MEILI_NO_ANALYTICS: 'true' + +jobs: + + meilisearch-js-tests: + name: JS SDK tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - uses: actions/checkout@v3 + with: + repository: meilisearch/meilisearch-js + - name: Setup node + uses: actions/setup-node@v3 + with: + cache: 'yarn' + - name: Install dependencies + run: yarn --dev + - name: Run tests + run: yarn test + - name: Build project + run: yarn build + - name: Run ESM env + run: yarn test:env:esm + - name: Run Node.js env + run: yarn test:env:nodejs + - name: Run node typescript env + run: yarn test:env:node-ts + - name: Run Browser env + run: yarn test:env:browser + + instant-meilisearch-tests: + name: instant-meilisearch tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - uses: actions/checkout@v3 + with: + repository: meilisearch/instant-meilisearch + - name: Setup node + uses: actions/setup-node@v3 + with: + cache: yarn + - name: Install dependencies + run: yarn install + - name: Run tests + run: yarn test + - name: Build all the playgrounds and the packages + run: yarn build + + meilisearch-php-tests: + name: PHP SDK tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - uses: actions/checkout@v3 + with: + repository: meilisearch/meilisearch-php + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + coverage: none + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies + run: | + composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction + composer update --prefer-dist --no-progress + - name: Run test suite - default HTTP client (Guzzle 7) + run: | + sh scripts/tests.sh + composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle + + meilisearch-python-tests: + name: Python SDK tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - uses: actions/checkout@v3 + with: + repository: meilisearch/meilisearch-python + - name: Set up Python + uses: actions/setup-python@v4 + - name: Install pipenv + uses: dschep/install-pipenv-action@v1 + - name: Install dependencies + run: pipenv install --dev --python=${{ matrix.python-version }} + - name: Test with pytest + run: pipenv run pytest + + meilisearch-go-tests: + name: Go SDK tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: stable + - uses: actions/checkout@v3 + with: + repository: meilisearch/meilisearch-go + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + - name: Run integration tests + run: go test -v ./... + + meilisearch-ruby-tests: + name: Ruby SDK tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - uses: actions/checkout@v3 + with: + repository: meilisearch/meilisearch-ruby + - name: Set up Ruby 3 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3 + - name: Install ruby dependencies + run: bundle install --with test + - name: Run test suite + run: bundle exec rspec + + meilisearch-rust-tests: + name: Rust SDK tests + runs-on: ubuntu-latest + services: + meilisearch: + image: getmeili/meilisearch:nightly + env: + MEILI_MASTER_KEY: ${{ env.MEILI_MASTER_KEY }} + MEILI_NO_ANALYTICS: ${{ env.MEILI_NO_ANALYTICS }} + ports: + - '7700:7700' + steps: + - uses: actions/checkout@v3 + with: + repository: meilisearch/meilisearch-rust + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose