Skip to content

Commit

Permalink
Add a linter check in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bidoubiwa committed Dec 22, 2022
1 parent 141024c commit e38f07f
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 82 deletions.
36 changes: 18 additions & 18 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
labels:
- 'skip-changelog'
- 'dependencies'
rebase-strategy: disabled
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
labels:
- 'skip-changelog'
- 'dependencies'
rebase-strategy: disabled

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
labels:
- skip-changelog
- dependencies
rebase-strategy: disabled
- package-ecosystem: gomod
directory: '/'
schedule:
interval: daily
time: '04:00'
open-pull-requests-limit: 10
labels:
- skip-changelog
- dependencies
rebase-strategy: disabled
55 changes: 27 additions & 28 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,36 @@ on:
branches: bump-meilisearch-v*

jobs:

integration_tests:
runs-on: ubuntu-latest
strategy:
matrix:
# Current go.mod version and latest stable go version
go: [1.16, 1.17]
include:
- go: 1.16
tag: current
- go: 1.17
tag: latest
matrix:
# Current go.mod version and latest stable go version
go: [1.16, 1.17]
include:
- go: 1.16
tag: current
- go: 1.17
tag: latest

name: integration-tests-against-rc (go ${{ matrix.tag }} version)
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- 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: 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 integration tests
run: go test -v ./...
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- 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: 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 integration tests
run: go test -v ./...
2 changes: 1 addition & 1 deletion .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Validate release version
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
Expand Down
74 changes: 39 additions & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,52 @@ jobs:
name: linter
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2
- name: Run go vet
run: go vet
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2
- name: Run go vet
run: go vet
- name: Yaml linter
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml

integration_tests:
runs-on: ubuntu-latest
# 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')
strategy:
matrix:
# Current go.mod version and latest stable go version
go: [1.16, 1.17]
include:
- go: 1.16
tag: current
- go: 1.17
tag: latest
matrix:
# Current go.mod version and latest stable go version
go: [1.16, 1.17]
include:
- go: 1.16
tag: current
- go: 1.17
tag: latest

name: integration-tests (go ${{ matrix.tag }} version)
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- 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: Meilisearch setup (latest version) with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --master-key=masterKey --no-analytics
- name: Run integration tests
run: go test -v ./...
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- 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: Meilisearch setup (latest version) with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --master-key=masterKey --no-analytics
- name: Run integration tests
run: go test -v ./...
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: |
node_modules
rules:
line-length: disable
document-start: disable
brackets: disable
truthy: disable

0 comments on commit e38f07f

Please sign in to comment.