Skip to content

Add yaml linting check in CI #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ indent_style = space
indent_size = 4
max_line_length = 120

[*.{yml,json}]
[*.{yml,yaml,json}]
indent_size = 2

[*.{neon,neon.dist}]
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ updates:
time: "04:00"
open-pull-requests-limit: 10
labels:
- dependencies
- skip-changelog
- dependencies
- skip-changelog
rebase-strategy: disabled

- package-ecosystem: "github-actions"
Expand Down
46 changes: 23 additions & 23 deletions .github/release-draft-template.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name-template: 'v$RESOLVED_VERSION 🎵'
tag-template: 'v$RESOLVED_VERSION'
exclude-labels:
- 'skip-changelog'
- 'skip-changelog'
version-resolver:
minor:
labels:
- 'breaking-change'
default: patch
minor:
labels:
- 'breaking-change'
default: patch
categories:
- title: '⚠️ Breaking changes'
label: 'breaking-change'
- title: '🚀 Enhancements'
label: 'enhancement'
- title: '🐛 Bug Fixes'
label: 'bug'
- title: '🔒 Security'
label: 'security'
- title: '⚠️ Breaking changes'
label: 'breaking-change'
- title: '🚀 Enhancements'
label: 'enhancement'
- title: '🐛 Bug Fixes'
label: 'bug'
- title: '🔒 Security'
label: 'security'
template: |
$CHANGES
$CHANGES

Thanks again to $CONTRIBUTORS! 🎉
Thanks again to $CONTRIBUTORS! 🎉
no-changes-template: 'Changes are coming soon 😎'
sort-direction: 'ascending'
replacers:
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@bors(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@meili-bot,?/g'
replace: ''
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@bors(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@meili-bot,?/g'
replace: ''
56 changes: 28 additions & 28 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ name: Pre-Release Tests

# Will only run for PRs and pushes to bump-meilisearch-v*
on:
push:
branches:
- bump-meilisearch-v*
pull_request:
branches:
- bump-meilisearch-v*
push:
branches:
- bump-meilisearch-v*
pull_request:
branches:
- bump-meilisearch-v*

jobs:
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0']
name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --quiet
- name: Get the latest Meilisearch RC
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
- name: Run test suite
run: composer test:unit
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0']
name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --quiet
- name: Get the latest Meilisearch RC
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
- name: Run test suite
run: composer test:unit
22 changes: 11 additions & 11 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Release Drafter

on:
push:
branches:
- main
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-draft-template.yml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_DRAFTER_TOKEN }}
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-draft-template.yml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_DRAFTER_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,13 @@ jobs:
run: |
vendor/bin/simple-phpunit --version
composer phpstan

yaml-lint:
name: Yaml linting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Yaml lint check
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml
9 changes: 9 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: default
ignore: |
vendor
rules:
comments-indentation: disable
line-length: disable
document-start: disable
brackets: disable
truthy: disable
108 changes: 54 additions & 54 deletions tests/config/meilisearch.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
meilisearch:
url: '%env(MEILISEARCH_URL)%'
api_key: '%env(MEILISEARCH_API_KEY)%'
prefix: '%env(MEILISEARCH_PREFIX)%_'
nbResults: 12
batchSize: 100
indices:
- name: posts
class: 'Meilisearch\Bundle\Tests\Entity\Post'
enable_serializer_groups: true
settings:
stopWords: ['the', 'a', 'an']
filterableAttributes: ['title', 'publishedAt']
typoTolerance:
enabled: true
disableOnAttributes: ['title']
disableOnWords: ['york']
minWordSizeForTypos:
oneTypo: 5
twoTypos: 9
- name: comments
class: 'Meilisearch\Bundle\Tests\Entity\Comment'
- name: aggregated
class: 'Meilisearch\Bundle\Tests\Entity\ContentAggregator'
index_if: isVisible
- name: tags
class: 'Meilisearch\Bundle\Tests\Entity\Tag'
index_if: isPublic
# Yes, we want to have links in the same index as tags
# We just set the same index name 'tags'
- name: tags
class: 'Meilisearch\Bundle\Tests\Entity\Link'
index_if: isSponsored
- name: pages
class: 'Meilisearch\Bundle\Tests\Entity\Page'
enable_serializer_groups: true
- name: self_normalizable
class: 'Meilisearch\Bundle\Tests\Entity\SelfNormalizable'
- name: dummy_custom_groups
class: 'Meilisearch\Bundle\Tests\Entity\DummyCustomGroups'
enable_serializer_groups: true
serializer_groups: ['public', 'private']
- name: dynamic_settings
class: 'Meilisearch\Bundle\Tests\Entity\DynamicSettings'
settings:
filterableAttributes:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\FilterableAttributes'
searchableAttributes:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\SearchableAttributes'
stopWords:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\StopWords'
synonyms:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\Synonyms'
url: '%env(MEILISEARCH_URL)%'
api_key: '%env(MEILISEARCH_API_KEY)%'
prefix: '%env(MEILISEARCH_PREFIX)%_'
nbResults: 12
batchSize: 100
indices:
- name: posts
class: 'Meilisearch\Bundle\Tests\Entity\Post'
enable_serializer_groups: true
settings:
stopWords: ['the', 'a', 'an']
filterableAttributes: ['title', 'publishedAt']
typoTolerance:
enabled: true
disableOnAttributes: ['title']
disableOnWords: ['york']
minWordSizeForTypos:
oneTypo: 5
twoTypos: 9
- name: comments
class: 'Meilisearch\Bundle\Tests\Entity\Comment'
- name: aggregated
class: 'Meilisearch\Bundle\Tests\Entity\ContentAggregator'
index_if: isVisible
- name: tags
class: 'Meilisearch\Bundle\Tests\Entity\Tag'
index_if: isPublic
# Yes, we want to have links in the same index as tags
# We just set the same index name 'tags'
- name: tags
class: 'Meilisearch\Bundle\Tests\Entity\Link'
index_if: isSponsored
- name: pages
class: 'Meilisearch\Bundle\Tests\Entity\Page'
enable_serializer_groups: true
- name: self_normalizable
class: 'Meilisearch\Bundle\Tests\Entity\SelfNormalizable'
- name: dummy_custom_groups
class: 'Meilisearch\Bundle\Tests\Entity\DummyCustomGroups'
enable_serializer_groups: true
serializer_groups: ['public', 'private']
- name: dynamic_settings
class: 'Meilisearch\Bundle\Tests\Entity\DynamicSettings'
settings:
filterableAttributes:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\FilterableAttributes'
searchableAttributes:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\SearchableAttributes'
stopWords:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\StopWords'
synonyms:
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\Synonyms'

services:
Meilisearch\Bundle\Tests\Integration\Fixtures\:
resource: '../Integration/Fixtures/'
Meilisearch\Bundle\Tests\Integration\Fixtures\:
resource: '../Integration/Fixtures/'