Skip to content

Commit 291d5ad

Browse files
meili-bors[bot]meili-botbrunoocasali
authored
Merge #264
264: Add yaml linting check in CI r=brunoocasali a=meili-bot _This PR is auto-generated._ To avoid mistakes in the `yaml` files, for example, duplicated keys or wrong indentation, we decided to add a lint check on `yaml` files. Additional to the `.yamllint` files added in this pr, the following must be added as well: - Linting check in CI: Example in `tests.yml create a new job: ```yaml 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 ``` - Inside `.yamllint`, you might want to ignore some folders. For example `node_modules` in JS repos Example in `.yamllint`: ```yaml ignore: | node_modules ```` Since `yamllint` is a python package, we cannot add a local check unless you download [`.yamllint`](https://github.com/adrienverge/yamllint). In which case, you can check if the yaml files are correctly linted by running the following command: `yamllint .` Additionally, you can use the VSCode extension [`YAML` by redhat](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) which automatically highlights errors. To help users be aware of this, we recommend adding this to your contributing guide: ``` To check if your `yaml` files are correctly formatted, you need to [install yamllint](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) and then run `yamllint .` ```` ## TODO - [ ] Add the directories or files to ignore in `.yamllint` - [ ] Add information in the contributing guide on this new check. Co-authored-by: meili-bot <[email protected]> Co-authored-by: Bruno Casali <[email protected]>
2 parents 8151791 + 1bc28c2 commit 291d5ad

File tree

8 files changed

+138
-119
lines changed

8 files changed

+138
-119
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ indent_style = space
1111
indent_size = 4
1212
max_line_length = 120
1313

14-
[*.{yml,json}]
14+
[*.{yml,yaml,json}]
1515
indent_size = 2
1616

1717
[*.{neon,neon.dist}]

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ updates:
88
time: "04:00"
99
open-pull-requests-limit: 10
1010
labels:
11-
- dependencies
12-
- skip-changelog
11+
- dependencies
12+
- skip-changelog
1313
rebase-strategy: disabled
1414

1515
- package-ecosystem: "github-actions"

.github/release-draft-template.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
name-template: 'v$RESOLVED_VERSION 🎵'
22
tag-template: 'v$RESOLVED_VERSION'
33
exclude-labels:
4-
- 'skip-changelog'
4+
- 'skip-changelog'
55
version-resolver:
6-
minor:
7-
labels:
8-
- 'breaking-change'
9-
default: patch
6+
minor:
7+
labels:
8+
- 'breaking-change'
9+
default: patch
1010
categories:
11-
- title: '⚠️ Breaking changes'
12-
label: 'breaking-change'
13-
- title: '🚀 Enhancements'
14-
label: 'enhancement'
15-
- title: '🐛 Bug Fixes'
16-
label: 'bug'
17-
- title: '🔒 Security'
18-
label: 'security'
11+
- title: '⚠️ Breaking changes'
12+
label: 'breaking-change'
13+
- title: '🚀 Enhancements'
14+
label: 'enhancement'
15+
- title: '🐛 Bug Fixes'
16+
label: 'bug'
17+
- title: '🔒 Security'
18+
label: 'security'
1919
template: |
20-
$CHANGES
20+
$CHANGES
2121
22-
Thanks again to $CONTRIBUTORS! 🎉
22+
Thanks again to $CONTRIBUTORS! 🎉
2323
no-changes-template: 'Changes are coming soon 😎'
2424
sort-direction: 'ascending'
2525
replacers:
26-
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
27-
replace: ''
28-
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
29-
replace: ''
30-
- search: '/(?:and )?@bors(?:\[bot\])?,?/g'
31-
replace: ''
32-
- search: '/(?:and )?@meili-bot,?/g'
33-
replace: ''
26+
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
27+
replace: ''
28+
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
29+
replace: ''
30+
- search: '/(?:and )?@bors(?:\[bot\])?,?/g'
31+
replace: ''
32+
- search: '/(?:and )?@meili-bot,?/g'
33+
replace: ''

.github/workflows/pre-release-tests.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ name: Pre-Release Tests
33

44
# Will only run for PRs and pushes to bump-meilisearch-v*
55
on:
6-
push:
7-
branches:
8-
- bump-meilisearch-v*
9-
pull_request:
10-
branches:
11-
- bump-meilisearch-v*
6+
push:
7+
branches:
8+
- bump-meilisearch-v*
9+
pull_request:
10+
branches:
11+
- bump-meilisearch-v*
1212

1313
jobs:
14-
integration-tests:
15-
runs-on: ubuntu-latest
16-
strategy:
17-
matrix:
18-
php-versions: ['7.4', '8.0']
19-
name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
20-
steps:
21-
- uses: actions/checkout@v3
22-
- name: Install PHP
23-
uses: shivammathur/setup-php@v2
24-
with:
25-
php-version: ${{ matrix.php-versions }}
26-
- name: Validate composer.json and composer.lock
27-
run: composer validate
28-
- name: Install dependencies
29-
run: composer install --prefer-dist --no-progress --quiet
30-
- name: Get the latest Meilisearch RC
31-
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
32-
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
33-
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
34-
- name: Run test suite
35-
run: composer test:unit
14+
integration-tests:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
php-versions: ['7.4', '8.0']
19+
name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Install PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
- name: Validate composer.json and composer.lock
27+
run: composer validate
28+
- name: Install dependencies
29+
run: composer install --prefer-dist --no-progress --quiet
30+
- name: Get the latest Meilisearch RC
31+
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
32+
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
33+
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
34+
- name: Run test suite
35+
run: composer test:unit

.github/workflows/release-drafter.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: Release Drafter
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
push:
5+
branches:
6+
- main
77

88
jobs:
9-
update_release_draft:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: release-drafter/release-drafter@v5
13-
with:
14-
config-name: release-draft-template.yml
15-
env:
16-
GITHUB_TOKEN: ${{ secrets.RELEASE_DRAFTER_TOKEN }}
9+
update_release_draft:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
with:
14+
config-name: release-draft-template.yml
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.RELEASE_DRAFTER_TOKEN }}

.github/workflows/tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ jobs:
8383
run: |
8484
vendor/bin/simple-phpunit --version
8585
composer phpstan
86+
87+
yaml-lint:
88+
name: Yaml linting check
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v3
92+
- name: Yaml lint check
93+
uses: ibiqlik/action-yamllint@v3
94+
with:
95+
config_file: .yamllint.yml

.yamllint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: default
2+
ignore: |
3+
vendor
4+
rules:
5+
comments-indentation: disable
6+
line-length: disable
7+
document-start: disable
8+
brackets: disable
9+
truthy: disable

tests/config/meilisearch.yaml

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
meilisearch:
2-
url: '%env(MEILISEARCH_URL)%'
3-
api_key: '%env(MEILISEARCH_API_KEY)%'
4-
prefix: '%env(MEILISEARCH_PREFIX)%_'
5-
nbResults: 12
6-
batchSize: 100
7-
indices:
8-
- name: posts
9-
class: 'Meilisearch\Bundle\Tests\Entity\Post'
10-
enable_serializer_groups: true
11-
settings:
12-
stopWords: ['the', 'a', 'an']
13-
filterableAttributes: ['title', 'publishedAt']
14-
typoTolerance:
15-
enabled: true
16-
disableOnAttributes: ['title']
17-
disableOnWords: ['york']
18-
minWordSizeForTypos:
19-
oneTypo: 5
20-
twoTypos: 9
21-
- name: comments
22-
class: 'Meilisearch\Bundle\Tests\Entity\Comment'
23-
- name: aggregated
24-
class: 'Meilisearch\Bundle\Tests\Entity\ContentAggregator'
25-
index_if: isVisible
26-
- name: tags
27-
class: 'Meilisearch\Bundle\Tests\Entity\Tag'
28-
index_if: isPublic
29-
# Yes, we want to have links in the same index as tags
30-
# We just set the same index name 'tags'
31-
- name: tags
32-
class: 'Meilisearch\Bundle\Tests\Entity\Link'
33-
index_if: isSponsored
34-
- name: pages
35-
class: 'Meilisearch\Bundle\Tests\Entity\Page'
36-
enable_serializer_groups: true
37-
- name: self_normalizable
38-
class: 'Meilisearch\Bundle\Tests\Entity\SelfNormalizable'
39-
- name: dummy_custom_groups
40-
class: 'Meilisearch\Bundle\Tests\Entity\DummyCustomGroups'
41-
enable_serializer_groups: true
42-
serializer_groups: ['public', 'private']
43-
- name: dynamic_settings
44-
class: 'Meilisearch\Bundle\Tests\Entity\DynamicSettings'
45-
settings:
46-
filterableAttributes:
47-
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\FilterableAttributes'
48-
searchableAttributes:
49-
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\SearchableAttributes'
50-
stopWords:
51-
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\StopWords'
52-
synonyms:
53-
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\Synonyms'
2+
url: '%env(MEILISEARCH_URL)%'
3+
api_key: '%env(MEILISEARCH_API_KEY)%'
4+
prefix: '%env(MEILISEARCH_PREFIX)%_'
5+
nbResults: 12
6+
batchSize: 100
7+
indices:
8+
- name: posts
9+
class: 'Meilisearch\Bundle\Tests\Entity\Post'
10+
enable_serializer_groups: true
11+
settings:
12+
stopWords: ['the', 'a', 'an']
13+
filterableAttributes: ['title', 'publishedAt']
14+
typoTolerance:
15+
enabled: true
16+
disableOnAttributes: ['title']
17+
disableOnWords: ['york']
18+
minWordSizeForTypos:
19+
oneTypo: 5
20+
twoTypos: 9
21+
- name: comments
22+
class: 'Meilisearch\Bundle\Tests\Entity\Comment'
23+
- name: aggregated
24+
class: 'Meilisearch\Bundle\Tests\Entity\ContentAggregator'
25+
index_if: isVisible
26+
- name: tags
27+
class: 'Meilisearch\Bundle\Tests\Entity\Tag'
28+
index_if: isPublic
29+
# Yes, we want to have links in the same index as tags
30+
# We just set the same index name 'tags'
31+
- name: tags
32+
class: 'Meilisearch\Bundle\Tests\Entity\Link'
33+
index_if: isSponsored
34+
- name: pages
35+
class: 'Meilisearch\Bundle\Tests\Entity\Page'
36+
enable_serializer_groups: true
37+
- name: self_normalizable
38+
class: 'Meilisearch\Bundle\Tests\Entity\SelfNormalizable'
39+
- name: dummy_custom_groups
40+
class: 'Meilisearch\Bundle\Tests\Entity\DummyCustomGroups'
41+
enable_serializer_groups: true
42+
serializer_groups: ['public', 'private']
43+
- name: dynamic_settings
44+
class: 'Meilisearch\Bundle\Tests\Entity\DynamicSettings'
45+
settings:
46+
filterableAttributes:
47+
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\FilterableAttributes'
48+
searchableAttributes:
49+
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\SearchableAttributes'
50+
stopWords:
51+
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\StopWords'
52+
synonyms:
53+
_service: '@Meilisearch\Bundle\Tests\Integration\Fixtures\Synonyms'
5454

5555
services:
56-
Meilisearch\Bundle\Tests\Integration\Fixtures\:
57-
resource: '../Integration/Fixtures/'
56+
Meilisearch\Bundle\Tests\Integration\Fixtures\:
57+
resource: '../Integration/Fixtures/'

0 commit comments

Comments
 (0)