Merge #380 #1235
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
push: | |
# trying and staging branches are for BORS config | |
branches: | |
- trying | |
- staging | |
- main | |
env: | |
MEILISEARCH_URL: http://localhost:7700 | |
jobs: | |
integration-tests: | |
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR) | |
# Will still run for each push to bump-meilisearch-v* | |
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v') | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ['latest'] | |
name: integration-tests (dart ${{ matrix.version }}) | |
services: | |
meilisearch: | |
image: getmeili/meilisearch:latest | |
env: | |
MEILI_MASTER_KEY: "masterKey" | |
MEILI_NO_ANALYTICS: "true" | |
ports: | |
- 7700:7700 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ matrix.version }} | |
- name: Install dependencies | |
run: | | |
dart pub get | |
dart pub get -C tool | |
dart pub global activate coverage | |
- name: Run integration tests | |
run: dart test --concurrency=4 --reporter=github --coverage=./coverage/reports | |
- name: Generate coverage reports | |
run: dart pub global run coverage:format_coverage --report-on=./lib --lcov --in=./coverage/reports --out=coverage/lcov.info | |
- name: Report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: coverage/lcov.info | |
fail_ci_if_error: false | |
linter: | |
name: linter-check | |
runs-on: ubuntu-latest | |
container: | |
image: dart:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
dart pub get | |
dart pub get -C tool | |
- name: Run linter | |
run: dart analyze --fatal-infos && dart format . --set-exit-if-changed | |
yaml-lint: | |
name: Yaml linting check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Yaml lint check | |
uses: ibiqlik/action-yamllint@v3 | |
with: | |
config_file: .yamllint.yml | |
check-code-samples: | |
name: check .code-samples.meilisearch.yaml | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: 'latest' | |
- name: check if samples changed | |
run: | | |
dart pub get | |
dart pub get -C tool | |
dart run ./tool/bin/meili.dart update-samples --fail-on-change | |
pana: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: '3.0.0' | |
- run: dart pub global activate pana | |
- name: Run pana | |
id: pana-run | |
run: | | |
echo "PANA_OUTPUT<<EOF" >> $GITHUB_ENV | |
dart pub global run pana --no-warning --exit-code-threshold 130 >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Analyze pana output | |
run: | | |
echo "$PANA_OUTPUT" | grep "Supports 6 of 6 possible platforms" |