Skip to content
New issue

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

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

Already on GitHub? # to your account

Test/feature/workflow/code analyzer #6

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Static Analysis

on: ["push"]

jobs:
build:
name: Build and Analyze
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.19'
- name: Clone Repository
uses: actions/checkout@master
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.organization=opensearch-go
-Dsonar.projectKey=zethuman_opensearch-go
-Dsonar.verbose=true
25 changes: 10 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Lint check

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
on: ["push"]

permissions:
contents: read

env:
GITHUB_ACTIONS: true
Expand All @@ -18,15 +15,13 @@ jobs:
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 1 }
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with: { go-version: '1.x' }
- name: Install dependencies
run: go install golang.org/x/lint/golint@latest
env:
GOBIN: ${{ env.GOROOT }}/bin
shell: bash
- run: go version
- run: make lint
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
args: -v -c .golangci.yml

prettify:
name: Prettify
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
run:
modules-download-mode: readonly
issues-exit-code: 0
issues-exit-code: 2

linters-settings:
exhaustive:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Adds `index_template` guide ([#289](https://github.com/opensearch-project/opensearch-go/pull/289))
- Adds `advanced_index_actions` guide ([#288](https://github.com/opensearch-project/opensearch-go/pull/288))
- Adds testcases to check UpdateByQuery functionality ([#304](https://github.com/opensearch-project/opensearch-go/pull/304))
- Adds additional timeout after cluster start ([##303](https://github.com/opensearch-project/opensearch-go/pull/303))
- Adds additional timeout after cluster start ([#303](https://github.com/opensearch-project/opensearch-go/pull/303))
- Adds Codacy as quality analysis tool ([#313](https://github.com/opensearch-project/opensearch-go/pull/313))

### Changed

Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/opensearch-project/opensearch-go.svg)](https://pkg.go.dev/github.com/opensearch-project/opensearch-go/v2) [![Build](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml) [![Unit](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml) [![Integration](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml) [![codecov](https://codecov.io/gh/opensearch-project/opensearch-go/branch/main/graph/badge.svg?token=MI9g3KYHVx)](https://codecov.io/gh/opensearch-project/opensearch-go) [![Chat](https://img.shields.io/badge/chat-on%20forums-blue)](https://discuss.opendistrocommunity.dev/c/clients/) ![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success)
[![Go Reference](https://pkg.go.dev/badge/github.com/opensearch-project/opensearch-go.svg)](https://pkg.go.dev/github.com/opensearch-project/opensearch-go/v2)
[![Build](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a6371b0f281142a0b30a9c537d9fdb7e)](https://app.codacy.com/gh/zethuman/opensearch-go/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Unit](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml)
[![Integration](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml)
[![codecov](https://codecov.io/gh/opensearch-project/opensearch-go/branch/main/graph/badge.svg?token=MI9g3KYHVx)](https://codecov.io/gh/opensearch-project/opensearch-go)
[![Chat](https://img.shields.io/badge/chat-on%20forums-blue)](https://discuss.opendistrocommunity.dev/c/clients/)
![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success)

![OpenSearch logo](OpenSearch.svg)

Expand All @@ -12,7 +19,10 @@ OpenSearch Go Client

## Welcome!

**opensearch-go** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of go-elasticsearch licensed under the [Apache v2.0 License](LICENSE.txt). For more information, see [opensearch.org](https://opensearch.org/).
**opensearch-go** is
[a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/)
of go-elasticsearch licensed under the [Apache v2.0 License](LICENSE.txt). For
more information, see [opensearch.org](https://opensearch.org/).

## Project Resources

Expand All @@ -31,7 +41,12 @@ OpenSearch Go Client

## Code of Conduct

This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments.
This project has adopted the
[Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information
see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or
contact
[opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com)
with any additional questions or comments.

## License

Expand Down